Submission #2806

#TimeUsernameProblemLanguageResultExecution timeMemory
2806kk1401속이기 (GA5_fake)C++98
100 / 100
0 ms1092 KiB
#include<stdio.h> #include<algorithm> int d[1001]; int main() { int i,k,sum=0,n; scanf("%d",&n); for(i=1; i<=n; i++) scanf("%d",&d[i]); std::sort(d+1,d+n+1); k=sum=d[2]; for(i=3; i<=n; i++){ k=k^d[i]; sum+=d[i]; } if(k==d[1]) printf("%d\n",sum>d[1]?sum:d[1]); else printf("0\n"); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...