# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
55144 | 2018-07-06T06:24:18 Z | khsoo01(#2065) | None (JOI14_ho_t3) | C++11 | 17 ms | 748 KB |
#include<bits/stdc++.h> using namespace std; typedef long long ll; const ll N = 100005, inf = 1e12; ll n, a[2*N], nxt[N]; bool can (ll V) { for(ll S=0, E=-1, X=0; S < n;) { if(X >= V || E - S >= n) { nxt[S] = E+1; X -= a[S]; S++; } else { E++; X += a[E]; } } for(ll i=0;i<n;i++) { ll C = i, l = 0; for(ll j=0;j<3;j++) { l += nxt[C] - C; C = nxt[C] % n; } if(l <= n) return true; } return false; } int main() { scanf("%lld",&n); for(ll i=0;i<n;i++) { scanf("%lld",&a[i]); a[i+n] = a[i]; } ll S = 0, E = inf; while(S<E) { ll M = (S+E)/2+1; can(M) ? S = M : E = M-1; } printf("%lld\n",S); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 356 KB | Output is correct |
3 | Correct | 2 ms | 432 KB | Output is correct |
4 | Correct | 3 ms | 560 KB | Output is correct |
5 | Correct | 2 ms | 560 KB | Output is correct |
6 | Correct | 2 ms | 560 KB | Output is correct |
7 | Correct | 2 ms | 560 KB | Output is correct |
8 | Correct | 2 ms | 576 KB | Output is correct |
9 | Correct | 2 ms | 576 KB | Output is correct |
10 | Correct | 2 ms | 576 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 356 KB | Output is correct |
3 | Correct | 2 ms | 432 KB | Output is correct |
4 | Correct | 3 ms | 560 KB | Output is correct |
5 | Correct | 2 ms | 560 KB | Output is correct |
6 | Correct | 2 ms | 560 KB | Output is correct |
7 | Correct | 2 ms | 560 KB | Output is correct |
8 | Correct | 2 ms | 576 KB | Output is correct |
9 | Correct | 2 ms | 576 KB | Output is correct |
10 | Correct | 2 ms | 576 KB | Output is correct |
11 | Correct | 3 ms | 576 KB | Output is correct |
12 | Correct | 3 ms | 616 KB | Output is correct |
13 | Correct | 4 ms | 616 KB | Output is correct |
14 | Correct | 2 ms | 616 KB | Output is correct |
15 | Correct | 3 ms | 616 KB | Output is correct |
16 | Correct | 3 ms | 616 KB | Output is correct |
17 | Correct | 2 ms | 620 KB | Output is correct |
18 | Correct | 2 ms | 620 KB | Output is correct |
19 | Correct | 3 ms | 620 KB | Output is correct |
20 | Correct | 3 ms | 620 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 356 KB | Output is correct |
3 | Correct | 2 ms | 432 KB | Output is correct |
4 | Correct | 3 ms | 560 KB | Output is correct |
5 | Correct | 2 ms | 560 KB | Output is correct |
6 | Correct | 2 ms | 560 KB | Output is correct |
7 | Correct | 2 ms | 560 KB | Output is correct |
8 | Correct | 2 ms | 576 KB | Output is correct |
9 | Correct | 2 ms | 576 KB | Output is correct |
10 | Correct | 2 ms | 576 KB | Output is correct |
11 | Correct | 3 ms | 576 KB | Output is correct |
12 | Correct | 3 ms | 616 KB | Output is correct |
13 | Correct | 4 ms | 616 KB | Output is correct |
14 | Correct | 2 ms | 616 KB | Output is correct |
15 | Correct | 3 ms | 616 KB | Output is correct |
16 | Correct | 3 ms | 616 KB | Output is correct |
17 | Correct | 2 ms | 620 KB | Output is correct |
18 | Correct | 2 ms | 620 KB | Output is correct |
19 | Correct | 3 ms | 620 KB | Output is correct |
20 | Correct | 3 ms | 620 KB | Output is correct |
21 | Correct | 14 ms | 748 KB | Output is correct |
22 | Correct | 14 ms | 748 KB | Output is correct |
23 | Correct | 15 ms | 748 KB | Output is correct |
24 | Correct | 12 ms | 748 KB | Output is correct |
25 | Correct | 17 ms | 748 KB | Output is correct |
26 | Incorrect | 8 ms | 748 KB | Output isn't correct |
27 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 356 KB | Output is correct |
3 | Correct | 2 ms | 432 KB | Output is correct |
4 | Correct | 3 ms | 560 KB | Output is correct |
5 | Correct | 2 ms | 560 KB | Output is correct |
6 | Correct | 2 ms | 560 KB | Output is correct |
7 | Correct | 2 ms | 560 KB | Output is correct |
8 | Correct | 2 ms | 576 KB | Output is correct |
9 | Correct | 2 ms | 576 KB | Output is correct |
10 | Correct | 2 ms | 576 KB | Output is correct |
11 | Correct | 3 ms | 576 KB | Output is correct |
12 | Correct | 3 ms | 616 KB | Output is correct |
13 | Correct | 4 ms | 616 KB | Output is correct |
14 | Correct | 2 ms | 616 KB | Output is correct |
15 | Correct | 3 ms | 616 KB | Output is correct |
16 | Correct | 3 ms | 616 KB | Output is correct |
17 | Correct | 2 ms | 620 KB | Output is correct |
18 | Correct | 2 ms | 620 KB | Output is correct |
19 | Correct | 3 ms | 620 KB | Output is correct |
20 | Correct | 3 ms | 620 KB | Output is correct |
21 | Correct | 14 ms | 748 KB | Output is correct |
22 | Correct | 14 ms | 748 KB | Output is correct |
23 | Correct | 15 ms | 748 KB | Output is correct |
24 | Correct | 12 ms | 748 KB | Output is correct |
25 | Correct | 17 ms | 748 KB | Output is correct |
26 | Incorrect | 8 ms | 748 KB | Output isn't correct |
27 | Halted | 0 ms | 0 KB | - |