# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
346839 | 2021-01-11T08:26:12 Z | arnold518 | MP3 Player (CEOI10_mp3player) | C++14 | 1000 ms | 2668 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 1e5; int N, Vmax, V2; pii A[MAXN+10]; int B[MAXN+10]; int main() { scanf("%d%d%d", &N, &Vmax, &V2); N--; int t; scanf(" %*c%d", &t); for(int i=1; i<=N; i++) { int p; char q; scanf(" %c%d", &q, &p); if(q=='+') A[i]={p-t, i}; else A[i]={p-t, -i}; t=p; } sort(A+1, A+N+1); int ans1=0, ans2=V2; A[N+1].first=2147483647; for(int i=1; i<=N; i++) { if(A[i].second>0) B[A[i].second]=1; else B[-A[i].second]=-1; int l=V2, r=V2; bool flag=true; for(int j=N; j>=1; j--) { if(B[j]==0) continue; if(B[j]==-1) { r++; l++; if(l==1) l--; r=min(r, Vmax); } if(B[j]==1) { r--; l--; if(r==Vmax-1) r++; l=max(l, 0); } if(l>r) { flag=false; break; } } if(flag) { ans1=A[i+1].first-1; ans2=r; } } if(ans1==2147483646) printf("infinity\n"); else printf("%d %d\n", ans1, ans2); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 21 ms | 364 KB | Output is correct |
2 | Incorrect | 10 ms | 364 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 492 KB | Output is correct |
2 | Correct | 6 ms | 364 KB | Output is correct |
3 | Incorrect | 2 ms | 364 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 81 ms | 876 KB | Output is correct |
2 | Execution timed out | 1049 ms | 1024 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 65 ms | 1004 KB | Output is correct |
2 | Execution timed out | 1088 ms | 1172 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 397 ms | 1132 KB | Output is correct |
2 | Execution timed out | 1080 ms | 1004 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1049 ms | 1388 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1093 ms | 2668 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1061 ms | 2668 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |