# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
947475 | 2024-03-16T09:01:19 Z | dilanyan | Intergalactic ship (IZhO19_xorsum) | C++17 | 2000 ms | 1468 KB |
//-------------dilanyan------------\\ #define _CRT_SECURE_NO_WARNINGS #include<bits/stdc++.h> #include<stdio.h> using namespace std; //------------------KarginDefines--------------------\\ #define ll long long #define pb push_back #define all(u) (u).begin(), (u).end() #define pqueue priority_queue #define upper upper_bound #define lower lower_bound #define umap unordered_map #define uset unordered_set #define Kargin ios_base::sync_with_stdio(false);cin.tie(NULL); #define Usaco freopen(".in", "r", stdin); freopen(".out", "w", stdout); //-------------------KarginConstants------------------\\ const ll mod = 1000000007; const ll inf = 1e9 + 15; //-------------------KarginCode------------------------\\ const int N = 1005,M = 100005; ll a[N]; struct query { int l, r, x; }; query q[M]; void KarginSolve() { int n; cin >> n; for (int i = 0;i < n;i++) cin >> a[i]; int m; cin >> m; for (int i = 0;i < m;i++) { cin >> q[i].l >> q[i].r >> q[i].x; q[i].l--; } ll ans = 0; for (int i = 0;i < (1 << m);i++) { for (int j = 0;j < m;j++) { if (i & (1 << j)) { for (int k = q[j].l;k < q[i].r;k++) a[k] ^= q[i].x; } } for (int x = 0;x < n;x++) { ll sum = 0; for (int j = x;j < n;j++) { sum += a[j]; sum %= mod; ans += sum * sum; ans %= mod; } } for (int j = 0;j < m;j++) { if (i & (1 << j)) { for (int k = q[j].l;k < q[i].r;k++) a[k] ^= q[i].x; } } } cout << ans << '\n'; } int main() { Kargin; int test = 1; //cin >> test; while (test--) { KarginSolve(); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Incorrect | 1 ms | 348 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Incorrect | 1 ms | 348 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 1468 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2077 ms | 464 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 189 ms | 592 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 189 ms | 592 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Incorrect | 1 ms | 348 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Incorrect | 1 ms | 348 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Incorrect | 1 ms | 348 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |