# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
55148 | 2018-07-06T06:30:36 Z | khsoo01(#2065) | None (JOI14_ho_t3) | C++11 | 15 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-1) { 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 | 376 KB | Output is correct |
2 | Correct | 2 ms | 464 KB | Output is correct |
3 | Correct | 2 ms | 464 KB | Output is correct |
4 | Correct | 2 ms | 464 KB | Output is correct |
5 | Correct | 3 ms | 464 KB | Output is correct |
6 | Correct | 3 ms | 468 KB | Output is correct |
7 | Correct | 2 ms | 476 KB | Output is correct |
8 | Correct | 4 ms | 476 KB | Output is correct |
9 | Correct | 3 ms | 476 KB | Output is correct |
10 | Correct | 3 ms | 524 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 464 KB | Output is correct |
3 | Correct | 2 ms | 464 KB | Output is correct |
4 | Correct | 2 ms | 464 KB | Output is correct |
5 | Correct | 3 ms | 464 KB | Output is correct |
6 | Correct | 3 ms | 468 KB | Output is correct |
7 | Correct | 2 ms | 476 KB | Output is correct |
8 | Correct | 4 ms | 476 KB | Output is correct |
9 | Correct | 3 ms | 476 KB | Output is correct |
10 | Correct | 3 ms | 524 KB | Output is correct |
11 | Correct | 3 ms | 572 KB | Output is correct |
12 | Correct | 2 ms | 596 KB | Output is correct |
13 | Correct | 3 ms | 712 KB | Output is correct |
14 | Correct | 3 ms | 712 KB | Output is correct |
15 | Correct | 3 ms | 712 KB | Output is correct |
16 | Correct | 3 ms | 712 KB | Output is correct |
17 | Correct | 3 ms | 712 KB | Output is correct |
18 | Correct | 3 ms | 712 KB | Output is correct |
19 | Correct | 3 ms | 712 KB | Output is correct |
20 | Correct | 3 ms | 712 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 464 KB | Output is correct |
3 | Correct | 2 ms | 464 KB | Output is correct |
4 | Correct | 2 ms | 464 KB | Output is correct |
5 | Correct | 3 ms | 464 KB | Output is correct |
6 | Correct | 3 ms | 468 KB | Output is correct |
7 | Correct | 2 ms | 476 KB | Output is correct |
8 | Correct | 4 ms | 476 KB | Output is correct |
9 | Correct | 3 ms | 476 KB | Output is correct |
10 | Correct | 3 ms | 524 KB | Output is correct |
11 | Correct | 3 ms | 572 KB | Output is correct |
12 | Correct | 2 ms | 596 KB | Output is correct |
13 | Correct | 3 ms | 712 KB | Output is correct |
14 | Correct | 3 ms | 712 KB | Output is correct |
15 | Correct | 3 ms | 712 KB | Output is correct |
16 | Correct | 3 ms | 712 KB | Output is correct |
17 | Correct | 3 ms | 712 KB | Output is correct |
18 | Correct | 3 ms | 712 KB | Output is correct |
19 | Correct | 3 ms | 712 KB | Output is correct |
20 | Correct | 3 ms | 712 KB | Output is correct |
21 | Correct | 13 ms | 740 KB | Output is correct |
22 | Correct | 12 ms | 740 KB | Output is correct |
23 | Correct | 13 ms | 740 KB | Output is correct |
24 | Correct | 13 ms | 740 KB | Output is correct |
25 | Correct | 15 ms | 740 KB | Output is correct |
26 | Incorrect | 7 ms | 748 KB | Output isn't correct |
27 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 464 KB | Output is correct |
3 | Correct | 2 ms | 464 KB | Output is correct |
4 | Correct | 2 ms | 464 KB | Output is correct |
5 | Correct | 3 ms | 464 KB | Output is correct |
6 | Correct | 3 ms | 468 KB | Output is correct |
7 | Correct | 2 ms | 476 KB | Output is correct |
8 | Correct | 4 ms | 476 KB | Output is correct |
9 | Correct | 3 ms | 476 KB | Output is correct |
10 | Correct | 3 ms | 524 KB | Output is correct |
11 | Correct | 3 ms | 572 KB | Output is correct |
12 | Correct | 2 ms | 596 KB | Output is correct |
13 | Correct | 3 ms | 712 KB | Output is correct |
14 | Correct | 3 ms | 712 KB | Output is correct |
15 | Correct | 3 ms | 712 KB | Output is correct |
16 | Correct | 3 ms | 712 KB | Output is correct |
17 | Correct | 3 ms | 712 KB | Output is correct |
18 | Correct | 3 ms | 712 KB | Output is correct |
19 | Correct | 3 ms | 712 KB | Output is correct |
20 | Correct | 3 ms | 712 KB | Output is correct |
21 | Correct | 13 ms | 740 KB | Output is correct |
22 | Correct | 12 ms | 740 KB | Output is correct |
23 | Correct | 13 ms | 740 KB | Output is correct |
24 | Correct | 13 ms | 740 KB | Output is correct |
25 | Correct | 15 ms | 740 KB | Output is correct |
26 | Incorrect | 7 ms | 748 KB | Output isn't correct |
27 | Halted | 0 ms | 0 KB | - |