# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
137565 | 2019-07-28T06:36:11 Z | 이온조(#3279) | Coins (BOI06_coins) | C++14 | 1000 ms | 367480 KB |
#include <bits/stdc++.h> using namespace std; const int L = 500000000; int N, K, C[500009], A[500009], mx = -1, mxi; char D[L + 1]; int main() { scanf("%d%d",&N,&K); for(int i=1; i<=N; i++) { scanf("%d%d",&C[i],&A[i]); A[i] = 1 - A[i]; } for(int i=1, j=1; i<K; i++) { if(i == C[j+1]) ++j; if(i - C[j] <= L) D[i] = D[i - C[j]] + A[j]; if(mx < D[i]) mx = D[i], mxi = K - i; } printf("%d\n%d", mx, mxi); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1111 ms | 367480 KB | Time limit exceeded |
2 | Incorrect | 2 ms | 476 KB | Output isn't correct |
3 | Execution timed out | 1087 ms | 354792 KB | Time limit exceeded |
4 | Execution timed out | 1102 ms | 363720 KB | Time limit exceeded |
5 | Execution timed out | 1076 ms | 332780 KB | Time limit exceeded |
6 | Execution timed out | 1092 ms | 356976 KB | Time limit exceeded |
7 | Execution timed out | 1085 ms | 321044 KB | Time limit exceeded |
8 | Execution timed out | 1097 ms | 332072 KB | Time limit exceeded |
9 | Execution timed out | 1092 ms | 327692 KB | Time limit exceeded |
10 | Execution timed out | 1083 ms | 316540 KB | Time limit exceeded |