# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
677651 | 2023-01-04T06:14:24 Z | mjhmjh1104 | Remittance (JOI19_remittance) | C++17 | 1 ms | 212 KB |
#include <cstdio> int n, a[1000006], b[1000006]; int main() { scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d%d", a + i, b + i); for (int i = 0; i < n; i++) a[i] -= b[i]; for (int t = 0; t < 2; t++) for (int i = 0; i < n; i++) { int curr = a[i], pos = i; while (curr > 1) { curr = curr / 2 * 2; a[pos] -= curr; pos = (pos + 1) % n; curr /= 2; a[pos] += curr; curr = a[pos]; } } bool fl = false; for (int i = 0; i < n; i++) if (a[i]) fl = true; puts(fl ? "No" : "Yes"); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Incorrect | 0 ms | 212 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Incorrect | 0 ms | 212 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Incorrect | 0 ms | 212 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |