# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
344189 | 2021-01-05T08:45:05 Z | Nurlykhan | Intergalactic ship (IZhO19_xorsum) | C++17 | 2000 ms | 1516 KB |
#include <bits/stdc++.h> using namespace std; const int N = (int)1e5 + 10; const int mod = (int)1e9 + 7; int n, q; int a[N], b[N]; int l[N], r[N], x[N], xr[N]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); scanf("%d", &q); for (int i = 0; i < q; i++) scanf("%d%d%d", &l[i], &r[i], &x[i]); int ans = 0; for (int i = 0; i < (1 << q); i++) { for (int j = 1; j <= n; j++) { xr[j] = 0; } for (int j = 0; j < q; j++) { if ((i >> j) % 2) { xr[l[j]] ^= x[j]; xr[r[j] + 1] ^= x[j]; } } for (int i = 1; i <= n; i++) { xr[i] ^= xr[i - 1]; b[i] = a[i] ^ xr[i]; } for (int i = 1; i <= n; i++) { int s = 0; for (int j = i; j <= n; j++) { s += b[j]; (ans += (s * 1ll * s) % mod) %= mod; } } } cout << ans; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 0 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 1 ms | 364 KB | Output is correct |
5 | Correct | 1 ms | 364 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 0 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 1 ms | 364 KB | Output is correct |
5 | Correct | 1 ms | 364 KB | Output is correct |
6 | Correct | 25 ms | 492 KB | Output is correct |
7 | Correct | 23 ms | 364 KB | Output is correct |
8 | Correct | 23 ms | 364 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 1516 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2085 ms | 364 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2067 ms | 364 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2067 ms | 364 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 0 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 1 ms | 364 KB | Output is correct |
5 | Correct | 1 ms | 364 KB | Output is correct |
6 | Correct | 25 ms | 492 KB | Output is correct |
7 | Correct | 23 ms | 364 KB | Output is correct |
8 | Correct | 23 ms | 364 KB | Output is correct |
9 | Execution timed out | 2067 ms | 364 KB | Time limit exceeded |
10 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 0 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 1 ms | 364 KB | Output is correct |
5 | Correct | 1 ms | 364 KB | Output is correct |
6 | Correct | 25 ms | 492 KB | Output is correct |
7 | Correct | 23 ms | 364 KB | Output is correct |
8 | Correct | 23 ms | 364 KB | Output is correct |
9 | Execution timed out | 2067 ms | 364 KB | Time limit exceeded |
10 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 0 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 1 ms | 364 KB | Output is correct |
5 | Correct | 1 ms | 364 KB | Output is correct |
6 | Correct | 25 ms | 492 KB | Output is correct |
7 | Correct | 23 ms | 364 KB | Output is correct |
8 | Correct | 23 ms | 364 KB | Output is correct |
9 | Incorrect | 23 ms | 1516 KB | Output isn't correct |
10 | Halted | 0 ms | 0 KB | - |