# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
152317 | 2019-09-07T12:18:46 Z | ivandasfs | Remittance (JOI19_remittance) | C++14 | 2 ms | 376 KB |
#include <iostream> #include <cstdio> using namespace std; pair<int, int> p[1000005]; int main() { int n; scanf("%d", &n); for (int i=0 ; i<n ; i++) { scanf("%d %d", &p[i].first, &p[i].second); } for (int j=0 ; j<50*n ; j++) { int i = j%n; int k = (i+1)%n; if (p[i].first>p[i].second) { int br = (p[i].first - p[i].second) / 2; p[i].first -= br*2; p[k].first += br; } } for (int i=0 ; i<n ; i++) { if (p[i].first != p[i].second) { printf("No\n"); return 0; } } printf("Yes\n"); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Incorrect | 2 ms | 248 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Incorrect | 2 ms | 248 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Incorrect | 2 ms | 248 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |