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 <cstdio>
int bit[17];
int arr[1000];
int min(int a,int b) {
return a<b ? a:b;
}
int main() {
int n, sum=0;
scanf("%d",&n);
for(int i=0;i<n;i++) {
scanf("%d",arr+i);
sum += arr[i];
for(int j=0;(1<<j)<=arr[i];j++)
if( (arr[i]&(1<<j)) > 0 )
bit[j]++;
}
for(int i=0;i<17;i++) {
if( bit[i]%2 == 1 ) {
puts("0");
return 0;
}
}
int minElement = 0x7fffffff;
for(int i=0;i<n;i++)
minElement = min(minElement,arr[i]);
printf("%d",sum-minElement);
}
# | 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... |