# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
65875 | 2018-08-09T05:05:28 Z | ikura355 | Cake (CEOI14_cake) | C++14 | 2000 ms | 9848 KB |
#include<bits/stdc++.h> using namespace std; const int maxn = 250000 + 5; int n,st,q; int a[maxn]; int main() { scanf("%d%d",&n,&st); for(int i=1;i<=n;i++) scanf("%d",&a[i]); scanf("%d",&q); while(q--) { char type; scanf(" %c",&type); if(type=='F') { int x; scanf("%d",&x); if(x==st) printf("0\n"); else if(x>st) { int mx = 0, l = st; for(int i=st+1;i<=x;i++) mx = max(mx, a[i]); for(int i=st-1;i>=1;i--) { if(a[i]>mx) break; l = i; } printf("%d\n",x-l); } else { int mx = 0, r = st; for(int i=st-1;i>=x;i--) mx = max(mx, a[i]); for(int i=st+1;i<=n;i++) { if(a[i]>mx) break; r = i; } printf("%d\n",r-x); } } else { int x,val; scanf("%d%d",&x,&val); int tmp = a[x]; for(int i=1;i<=n;i++) if(n-val+1>=a[i]) a[i]--; a[x] = n-val+1; // for(int i=1;i<=n;i++) printf("%d ",a[i]); // printf("\n"); } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 248 KB | Output is correct |
2 | Incorrect | 2 ms | 484 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2058 ms | 1504 KB | Time limit exceeded |
2 | Execution timed out | 2067 ms | 1800 KB | Time limit exceeded |
3 | Execution timed out | 2055 ms | 2804 KB | Time limit exceeded |
4 | Execution timed out | 2066 ms | 3140 KB | Time limit exceeded |
5 | Execution timed out | 2081 ms | 3840 KB | Time limit exceeded |
6 | Execution timed out | 2078 ms | 4260 KB | Time limit exceeded |
7 | Execution timed out | 2074 ms | 4900 KB | Time limit exceeded |
8 | Execution timed out | 2070 ms | 5216 KB | Time limit exceeded |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2061 ms | 6020 KB | Time limit exceeded |
2 | Execution timed out | 2037 ms | 6128 KB | Time limit exceeded |
3 | Execution timed out | 2019 ms | 6228 KB | Time limit exceeded |
4 | Incorrect | 2 ms | 6228 KB | Output isn't correct |
5 | Execution timed out | 2062 ms | 6408 KB | Time limit exceeded |
6 | Execution timed out | 2062 ms | 6492 KB | Time limit exceeded |
7 | Execution timed out | 2056 ms | 6644 KB | Time limit exceeded |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 118 ms | 6644 KB | Output isn't correct |
2 | Correct | 226 ms | 6644 KB | Output is correct |
3 | Execution timed out | 2053 ms | 6644 KB | Time limit exceeded |
4 | Execution timed out | 2063 ms | 6644 KB | Time limit exceeded |
5 | Incorrect | 236 ms | 6644 KB | Output isn't correct |
6 | Execution timed out | 2062 ms | 6644 KB | Time limit exceeded |
7 | Incorrect | 1255 ms | 7428 KB | Output isn't correct |
8 | Execution timed out | 2054 ms | 7428 KB | Time limit exceeded |
9 | Execution timed out | 2069 ms | 8224 KB | Time limit exceeded |
10 | Incorrect | 828 ms | 8660 KB | Output isn't correct |
11 | Execution timed out | 2060 ms | 9180 KB | Time limit exceeded |
12 | Execution timed out | 2054 ms | 9816 KB | Time limit exceeded |
13 | Execution timed out | 2070 ms | 9848 KB | Time limit exceeded |