This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |