Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- /*map<long long,long long>mapa;
- int main()
- {
- long long i,n,aux;
- scanf("%llu",&n);
- while(n!=0){
- mapa.clear();
- for(i=0;i<n;i++){
- scanf("%llu",&aux);
- mapa.insert(pair<long long,long long>(aux,0));
- mapa.find(aux)->second++;
- }
- /*for (map<long long,long long>::iterator it=mapa.begin(); it!=mapa.end(); ++it)
- {
- cout<<"chave = "<<it->first<<" "<<" valor = "<<it->second<<"\n";
- }*/
- /*long long resp = 0;
- for (map<long long,long long>::iterator it=mapa.begin(); it!=mapa.end(); ++it)
- {
- if(it->second % 2 != 0){
- resp = it->first;
- }
- }
- printf("%llu\n",resp);
- scanf("%llu",&n);
- }
- return 0;
- }*/
- #define max 100000
- #define gc getchar_unlocked
- long long B[max];
- void scanint(long long &x){
- register long long c = gc();
- x = 0;
- for(;(c < 48 || c>57);c = gc());
- for(;c>47 && c <58; c = gc()){
- x = (x<<1) + (x<<3) + c - 48;
- }
- }
- int main()
- {
- long long ones,twos,x,i,n;
- scanf("%llu",&n);
- while(n!=0){
- ones = twos = 0;
- memset(B,0,n*sizeof(long long));
- for(i=0;i<n;i++){
- //scanf("%llu",&B[i]);
- scanint(B[i]);
- }
- for(i=0;i<n;i++){
- x = B[i];
- ones ^= x;
- }
- printf("%llu\n", ones );
- scanf("%llu",&n);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement