# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
233291 | 2020-05-20T08:46:08 Z | triple_fault | Remittance (JOI19_remittance) | C++14 | 5 ms | 384 KB |
/* May 20 2020 */ #include <cstdio> #include <vector> #include <algorithm> #include <cstring> #include <cstdlib> #include <set> #include <map> #include <random> #define ll long long using namespace std; int main(void) { ll n; scanf("%lld", &n); ll a[n], b[n]; for (ll i = 0; i < n; ++i) scanf("%lld%lld", &a[i], &b[i]); for (;;) { bool uhh = false; for (ll i = 0; i < n; ++i) { if (a[i] <= b[i]) continue; uhh = true; ll ts = (a[i] - b[i] + 1) / 2; a[(i + 1) % n] += ts; a[i] -= (2 * ts); a[i] = max(a[i], 0LL); } if (!uhh) break; } for (ll i = 0; i < n; ++i) if (a[i] != b[i]) { puts("No"); return 0; } puts("Yes"); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Correct | 4 ms | 384 KB | Output is correct |
4 | Incorrect | 5 ms | 384 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Correct | 4 ms | 384 KB | Output is correct |
4 | Incorrect | 5 ms | 384 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Correct | 4 ms | 384 KB | Output is correct |
4 | Incorrect | 5 ms | 384 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |