Submission #12777

#TimeUsernameProblemLanguageResultExecution timeMemory
12777gs13068양말 찾기 (KPI13_socks)C++98
1 / 1
1944 ms1600 KiB
#include<cstdio> int d[2][65536]; int main() { int i,n,a,b; scanf("%d",&n); while(n--) { scanf("%d",&i); i+=1000000001; d[0][i>>16]^=i; d[1][i&65535]^=i; } a=b=0; for(i=0;i<65536;i++)if(d[0][i]) { if(a)b=d[0][i]; else a=d[0][i]; } if(!b) { a=b=0; for(i=0;i<65536;i++)if(d[1][i]) { if(a)b=d[1][i]; else a=d[1][i]; } } if(a>b)a^=b^=a^=b; printf("%d %d",a-1000000001,b-1000000001); }
#Verdict Execution timeMemoryGrader output
Fetching results...