# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
128616 | 2019-07-11T07:36:00 Z | E869120 | XOR Sum (info1cup17_xorsum) | C++14 | 196 ms | 22780 KB |
#include <iostream> using namespace std; #pragma warning (disable: 4996) long long N, A[1 << 20], V[1 << 20], ans; int main() { scanf("%lld", &N); for (int i = 1; i <= N; i++) scanf("%lld", &A[i]); if (N <= 5000) { for (int i = 1; i <= N; i++) { for (int j = i; j <= N; j++) ans ^= (A[i] + A[j]); } printf("%lld\n", ans); } else { for (int i = 1; i <= N; i++) V[A[i]]++; for (int i = 0; i <= 5000; i++) { for (int j = i + 1; j <= 5000; j++) { if ((1LL * V[i] * V[j]) % 2LL == 1LL) ans ^= (i + j); } if ((1LL * V[i] * (V[i] + 1)) / 2LL % 2LL == 1LL) ans ^= (i + i); } printf("%lld\n", ans); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 376 KB | Output is correct |
2 | Correct | 8 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 156 ms | 8284 KB | Output is correct |
2 | Correct | 149 ms | 12020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 156 ms | 8284 KB | Output is correct |
2 | Correct | 149 ms | 12020 KB | Output is correct |
3 | Incorrect | 196 ms | 22780 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 376 KB | Output is correct |
2 | Correct | 8 ms | 376 KB | Output is correct |
3 | Runtime error | 22 ms | 2168 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 376 KB | Output is correct |
2 | Correct | 8 ms | 376 KB | Output is correct |
3 | Correct | 156 ms | 8284 KB | Output is correct |
4 | Correct | 149 ms | 12020 KB | Output is correct |
5 | Incorrect | 196 ms | 22780 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |