# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
135474 | 2019-07-24T06:17:26 Z | 송준혁(#3252) | MP3 Player (CEOI10_mp3player) | C++14 | 1000 ms | 760 KB |
#include <bits/stdc++.h> #define INF 1234567890 using namespace std; typedef long long LL; typedef pair<int, int> pii; int N, V, T; int ans, V1; char ch[101010]; int d[101010]; int main(){ scanf("%d %d %d", &N, &V, &T); int x, y; for (int i=0; i<N; i++){ scanf(" %c %d", &ch[i], &y); d[i] = y - x, x = y; } d[N] = INF+1; for (int j=1; j<=N; j++){ int l=T, r=T; for (int i=N-1; i>0; i--){ if (d[i] > d[j]-1) continue; if (ch[i] == '+'){ l--; if (r != V) r--; } else{ r++; if (l != 0) l++; } if (l > V || r < 0) break; r = min(r, V); l = max(l, 0); } if (l <= V && r >= 0 && ans < d[j]-1) ans = d[j]-1, V1 = r; } if (ans == INF) puts("infinity"); else printf("%d %d\n", ans, V1); return 0; } /* 6 3 3 - 0 + 4 + 6 - 8 - 9 + 12 */
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 52 ms | 376 KB | Output is correct |
2 | Correct | 38 ms | 376 KB | Output is correct |
3 | Correct | 18 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 376 KB | Output is correct |
2 | Correct | 14 ms | 376 KB | Output is correct |
3 | Correct | 9 ms | 376 KB | Output is correct |
4 | Correct | 6 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 60 ms | 384 KB | Output is correct |
2 | Correct | 27 ms | 376 KB | Output is correct |
3 | Incorrect | 23 ms | 376 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 122 ms | 376 KB | Output is correct |
2 | Execution timed out | 1083 ms | 376 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 79 ms | 504 KB | Output is correct |
2 | Execution timed out | 1080 ms | 504 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 490 ms | 504 KB | Output is correct |
2 | Execution timed out | 1078 ms | 504 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1075 ms | 504 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1038 ms | 760 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1077 ms | 760 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |