# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
649454 | 2022-10-10T08:42:36 Z | birisi | XOR Sum (info1cup17_xorsum) | C++14 | 223 ms | 1400 KB |
#include <bits/stdc++.h> using namespace std; long long int say[5000]; int main() { int n; cin >> n; vector <int> v; int x; for (int i = 0; i < n; i++) { cin >> x; if (say[x] == 0) v.push_back(x); say[x]++; } long long int an = 0; vector <int> d; for (int i = 0; i < v.size(); i++) { x = v[i]; if (say[x]%2 == 1){ d.push_back(x); } if (say[x]%4 == 2 || say[x]%4 == 3) an = an^(2*x); } for (int i = 0; i < d.size(); i++) { for (int j = i; j < d.size(); j++) { an = an ^ (d[i] + d[j]); } } cout << an; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 223 ms | 340 KB | Output is correct |
2 | Correct | 218 ms | 1400 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 223 ms | 340 KB | Output is correct |
2 | Correct | 218 ms | 1400 KB | Output is correct |
3 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |