Problem Description
Give you a sequence of number,in which except for one element,
all number appears twice,your task is to find such a special one.
all number appears twice,your task is to find such a special one.
Input
The first line:N(N<=1000000)
The second line:a1,a2...an
(Use 'scanf' instead of 'cin' to esacpe from TLE,and use 64_bit
integer to hold the input)
The second line:a1,a2...an
(Use 'scanf' instead of 'cin' to esacpe from TLE,and use 64_bit
integer to hold the input)
Output
Only one number,the special one
Sample Input
5
1 1 2 2 3
#include
int main()
Sample Output
3#include
int main()
{
int n; __int64 t,m; scanf("%d%I64d",&n,&t); while(--n){
scanf("%I64d",&m); t ^= m;
}
printf("%I64d\n",t);
scanf("%I64d",&m); t ^= m;
}
printf("%I64d\n",t);
return 0;
}
没有评论:
发表评论