# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
585663 | 2022-06-29T07:54:58 Z | 박상훈(#8384) | MP3 Player (CEOI10_mp3player) | C++17 | 1000 ms | 1356 KB |
#include <bits/stdc++.h> typedef long long ll; using namespace std; const int INF = 2e9+400; bool p[100100], on[100100]; int a[100100], n, vmax, v2; void _press(int &L, int &R, bool P){ if (P){ if (L>0) --L; if (R==0) {L = -1; return;} else if (R<vmax) --R; } else{ if (R<vmax) ++R; if (L==vmax) {L = -1; return;} else if (L>0) ++L; } } void solve(int T){ for (int i=1;i<=n;i++) on[i] = a[i]<=T; int L = v2, R = v2; for (int i=n;i;i--) if (on[i]){ _press(L, R, p[i]); if (L==-1) return; } if (T==INF) printf("infinity\n"); else printf("%d %d\n", T, R); exit(0); } int main(){ scanf("%d %d %d", &n, &vmax, &v2); vector<int> V = {INF}; int prv = 0; for (int i=0;i<n;i++){ char op; int cur; scanf(" %c %d", &op, &cur); a[i] = cur - prv; prv = cur; on[i] = 1; if (op=='+') p[i] = 1; V.push_back(a[i]-1); } --n; sort(V.begin(), V.end(), greater<int>()); for (auto &x:V) solve(x); printf("0\n"); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 304 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Correct | 22 ms | 340 KB | Output is correct |
3 | Correct | 39 ms | 340 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 5 ms | 212 KB | Output is correct |
4 | Correct | 11 ms | 336 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 22 ms | 340 KB | Output is correct |
2 | Correct | 55 ms | 396 KB | Output is correct |
3 | Correct | 39 ms | 340 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 136 ms | 644 KB | Output is correct |
2 | Execution timed out | 1074 ms | 852 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 295 ms | 676 KB | Output is correct |
2 | Execution timed out | 1080 ms | 596 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 481 ms | 728 KB | Output is correct |
2 | Correct | 8 ms | 980 KB | Output is correct |
3 | Execution timed out | 1090 ms | 1192 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 434 ms | 876 KB | Output is correct |
2 | Execution timed out | 1082 ms | 852 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1082 ms | 1356 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1083 ms | 1348 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |