Submission #498763

# Submission time Handle Problem Language Result Execution time Memory
498763 2021-12-26T10:08:53 Z ahmedfouadnew XOR Sum (info1cup17_xorsum) C++17
11 / 100
269 ms 4512 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
int a[5005];
signed main()
{

    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        a[x]++;
    }
    int ans=0;
    for(int i=1;i<=4000;i++)
    {
        for(int j=i;j<=4000;j++)
        {
            if(!a[i]||!a[j]) continue;
            if(i==j&&(a[i]*(a[j]+1)/2)%2==0) continue;
            if(i!=j&&((a[i]*a[j])%2==0)) continue;
            ans^=(i+j);

        }
    }
    cout<<ans<<endl;
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 228 ms 300 KB Output is correct
2 Correct 269 ms 4512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 228 ms 300 KB Output is correct
2 Correct 269 ms 4512 KB Output is correct
3 Runtime error 1 ms 424 KB Execution killed with signal 11
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -