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>
int d[1001];
int main ()
{
int n,i,k=0,ind,min=9999999;
long long int sum=0;
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&d[i]);
sum=sum+d[i];
if(min>d[i]){
min=d[i];
ind=i;
}
}
sum=sum-min;
for(i=1;i<=n;i++){
if(ind==i)continue;
else if(k==0){
k=d[i];
continue;
}
k=k^d[i];
}
if(min==k)printf("%lld",sum);
else printf("0");
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... |