HDoj-2095-与众不同
Problem Description
card number will be the one that different from all the others.For example, there are 5 present, and their card numbers are 1, 2, 3, 2, 1.so your present will be the one with the card number of 3, because 3 is the number that different from all the others.
Input
Each case will be presented by an integer n (1<=n<=200, and n is odd) at first. Following that, n positive integers will be given in a line. These numbers indicate the card numbers of the presents.n = 0 ends the input.
Output
Sample Input
5
1 1 3 2 2
3
1 2 1
0
Sample Output
3
2
#include<stdio.h>
int main()
{
int T;
int n,m;
while(~scanf("%d",&T),T){
scanf("%d",&n); while(--T){
scanf("%d",&m);
n=m^n;
}
printf("%d\n",n);
} return 0;
}
HDoj-2095-与众不同的更多相关文章
- find your present (2) hdoj 2095
/* author:谦智 find your present (2) hdoj 2095 法一:用暴力 法二:用map 法三: 符号是^. 异或是个位运算符号,具体是怎么操作的请百度,这里有个特性使得 ...
- HDOJ 2095
find your present (2) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/1024 K (Java/Oth ...
- HDOJ 1009. Fat Mouse' Trade 贪心 结构体排序
FatMouse' Trade Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- HDOJ 1326. Box of Bricks 纯水题
Box of Bricks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) To ...
- .NET程序员细数Oracle与众不同的那些奇葩点
扯淡 距上次接触 Oracle 数据库已经是 N 年前的事了,Oracle 的工作方式以及某些点很特别,那会就感觉,这货就是一个奇葩!最近重拾记忆,一直在折腾 Oracle,因为 Oracle 与众不 ...
- HDOJ 1004 Let the Balloon Rise
Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...
- hdoj 1385Minimum Transport Cost
卧槽....最近刷的cf上有最短路,本来想拿这题复习一下.... 题意就是在输出最短路的情况下,经过每个节点会增加税收,另外要字典序输出,注意a到b和b到a的权值不同 然后就是处理字典序的问题,当松弛 ...
- HDOJ(2056)&HDOJ(1086)
Rectangles HDOJ(2056) http://acm.hdu.edu.cn/showproblem.php?pid=2056 题目描述:给2条线段,分别构成2个矩形,求2个矩形相交面 ...
- InstantClick – 快速响应!让你的网站与众不同
尽管网络带宽不断增加,但网站并没有更快很多.这是因为最大的瓶颈在于页面加载的延迟.InstantClick 是一个很小的 JavaScript 库,大大加速你的网站响应速度. 在访问者点击一个链接之前 ...
随机推荐
- tomcat8.5请求参数限制的问题
前段时间遇到这个问题: 包含json字符串类型的参数的http请求失败,返回状态码400,提示invalid character found in the request target. Tomcat ...
- [ZOJ3254] MON 9.2009Secret Code
A^x = D (mod P) 0 <= x <= M, here M is a given integer. 1 <= A, P < 2^31, 0 <= D < ...
- [HEOI2013]SAO
题目大意: 一个有向无环图上有n个结点, 现在告诉你n-1个条件(x,y),表示x和y的先后关系. 问原图共有几种可能的拓扑序? 思路: 树形DP. f[i][j]表示对于第i个结点,有j个点在它前面 ...
- php 导出excel
<?phpclass Excel { var $inEncode; var $outEncode; public function _construct() { } public functio ...
- C# 时间戳与当前时间互相转换
时间戳: Unix时间戳(Unix timestamp),或称Unix时间(Unix time).POSIX时间(POSIX time),是一种时间表示方式,定义为从格林威治时间1970年01月01日 ...
- Linux下Shell命令的输出信息同时显示在屏幕和保存到日志文件中
#直接覆盖日志文件 ls -l | tee ./t.log #将输出内容附加到日志文件 ls -l | tee -a ./t.log 使用的是tee命令
- Switching regulator forms constant-current source
Many applications require current sources rather than voltage sources. When you need a high-current ...
- IDA IDC Tutorials: Additional Auto-Commenting
https://www.hex-rays.com/products/ida/support/tutorials/idc/autocomment.shtml This program creates a ...
- ubuntn 内核升级到LINUX v4.11.8:
升级到LINUX v4.11.8: http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.11.8/linux-headers-4.11.8-041108_ ...
- SpringSecurity3整合CAS实现单点登录
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...