Submission #922625

# Submission time Handle Problem Language Result Execution time Memory
922625 2024-02-05T20:28:29 Z HaciyevAlik XOR Sum (info1cup17_xorsum) C++14
11 / 100
428 ms 29784 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mx=4*1000;
int main(){
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int n,x=0; cin >> n;
    unordered_map<int,int> mp;
    for(int i=1;i<=n;++i) {
        int x; cin >> x;
        mp[x]++;
    }
    for(int i=1;i<=mx;++i) {
        if(!mp[i]) continue;
        if((mp[i]*(mp[i]+1)/2)%2) {
            x^=(i*2);
        }
        for(int j=i+1;j<=mx;++j) {
            if(mp[i]&&mp[j]&&(mp[i]*mp[j]%2==1)) {
                x^=(i+j);
            }
        }
    }  
    cout << x;
    return 0;   
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 233 ms 5068 KB Output is correct
2 Correct 221 ms 4700 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 233 ms 5068 KB Output is correct
2 Correct 221 ms 4700 KB Output is correct
3 Incorrect 428 ms 29784 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -