# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
521978 | 2022-02-03T14:39:13 Z | maks007 | XOR Sum (info1cup17_xorsum) | C++14 | 1600 ms | 10028 KB |
#include <bits/stdc++.h> using namespace std; int main(void) { int n; cin>> n; vector <int> a(n); vector <int> idx((int)1e6, 0); for(int i = 0; i < n; i ++ ) { cin >> a[i]; idx[a[i]] ++; } int ans = 0; vector <int> even; sort(a.begin(), a.end()); //a.erase(unique(a.begin(), a.end()), a.end()); for(int k = 0; k < a.size(); k ++) { int i = a[k]; if(idx[i] == 0) continue; if(idx[i] % 2 == 1) continue; for(auto j : even) { //cout << i + j << ' '; ans ^= (j+i); } even.push_back(i); ans ^= (i*2); } for(int i = 0; i < a.size(); i ++) { if(idx[a[i]] % 2 == 1){ for(int j = i; j < a.size(); j ++) { // cout << (a[i] + a[j]) << " "; ans ^= (a[i] + a[j]); } } } cout << ans; return false; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 5 ms | 8388 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1676 ms | 10028 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1676 ms | 10028 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 5 ms | 8388 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 5 ms | 8388 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |