# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
522012 | 2022-02-03T15:20:39 Z | maks007 | XOR Sum (info1cup17_xorsum) | C++14 | 1600 ms | 36452 KB |
#include <bits/stdc++.h> using namespace std; int main(void) { int n; cin>> n; vector <int> a(n); map <int,int> idx; for(int i = 0; i < n; i ++ ) { cin >> a[i]; idx[a[i]] ++; } int ans = 0; sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end()); for(int i = 0; i < a.size(); i ++) { for(int j = 0; j < a.size(); j ++) { if(a[j] < a[i]) { if(idx[a[i]]%2 and idx[a[j]]%2) { ans ^= (a[i] + a[j]); } }else if(a[j] == a[i]){ int col = idx[a[i]] * (idx[a[i]] + 1) / 2; if(col % 2 == 1) { ans ^= (a[i] + a[j]); } } } } cout << ans; return false; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 443 ms | 580 KB | Output is correct |
2 | Correct | 435 ms | 512 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 659 ms | 5792 KB | Output is correct |
2 | Correct | 647 ms | 8412 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 659 ms | 5792 KB | Output is correct |
2 | Correct | 647 ms | 8412 KB | Output is correct |
3 | Execution timed out | 1694 ms | 36452 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 443 ms | 580 KB | Output is correct |
2 | Correct | 435 ms | 512 KB | Output is correct |
3 | Execution timed out | 1635 ms | 6412 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 443 ms | 580 KB | Output is correct |
2 | Correct | 435 ms | 512 KB | Output is correct |
3 | Correct | 659 ms | 5792 KB | Output is correct |
4 | Correct | 647 ms | 8412 KB | Output is correct |
5 | Execution timed out | 1694 ms | 36452 KB | Time limit exceeded |
6 | Halted | 0 ms | 0 KB | - |