# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
428089 | 2021-06-15T07:59:12 Z | Amylopectin | Remittance (JOI19_remittance) | C++14 | 1 ms | 292 KB |
#include <iostream> #include <stdio.h> using namespace std; const long long mxn = 4e6 + 10,mxi = 1e10 + 10; long long be[mxn] = {},af[mxn] = {},tw[mxn] = {}; long long fima(long long l,long long r) { if(l > r) return l; return r; } int main() { long long i,j,n,m,cma = 0,fr = 0,cva = 0,of = 0; scanf("%lld",&n); for(i=0; i<n; i++) { scanf("%lld %lld",&be[i],&af[i]); cma = fima(cma,be[i] - af[i]); } tw[0] = 1; for(i=1; i<40; i++) { tw[i] = tw[i-1] * 2; // if(tw[i] > cma) // { // break; // } } for(i=n-1; i>=0; i--) { cva += be[i] - af[i]; while(cva > 0 && fr < i) { if(n-i+fr > 35) { of = 1; break; } cva += (be[fr] - af[fr]) * tw[n-i + fr]; fr ++; } if(fr == i || of == 1) { break; } cva *= 2; if(cva > mxi) { of = 1; break; } } if(cva == 0 && of == 0) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 204 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Incorrect | 1 ms | 292 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 204 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Incorrect | 1 ms | 292 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 204 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Incorrect | 1 ms | 292 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |