# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
133027 | 2019-07-20T05:18:52 Z | tinjyu | Rice Hub (IOI11_ricehub) | C++14 | 20 ms | 2640 KB |
#include "ricehub.h" #include <iostream> using namespace std; long long int sum[100005],a[100005][2]; int besthub(int R, int L, int X[], long long B) { long long int now=0; sum[0]=X[0]; for(int i=1;i<R;i++) { sum[i]=sum[i-1]+X[i]; } long long int s=0,e=0; long long int ans=0; while(s<=e && e<R) { long long int mid=(s+e)/2; long long int tmp=(X[mid]*(mid-s)-(sum[mid-1]-sum[s-1])+(sum[e]-sum[mid])-X[mid]*(e-mid)); if(tmp<=B) { ans=max(ans,e-s+1); e++; } else s++; } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 344 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Correct | 2 ms | 376 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |
11 | Correct | 2 ms | 376 KB | Output is correct |
12 | Correct | 2 ms | 376 KB | Output is correct |
13 | Correct | 2 ms | 376 KB | Output is correct |
14 | Correct | 2 ms | 376 KB | Output is correct |
15 | Correct | 2 ms | 376 KB | Output is correct |
16 | Correct | 2 ms | 376 KB | Output is correct |
17 | Correct | 2 ms | 376 KB | Output is correct |
18 | Correct | 2 ms | 376 KB | Output is correct |
19 | Correct | 2 ms | 376 KB | Output is correct |
20 | Correct | 2 ms | 376 KB | Output is correct |
21 | Correct | 2 ms | 376 KB | Output is correct |
22 | Correct | 2 ms | 376 KB | Output is correct |
23 | Correct | 2 ms | 376 KB | Output is correct |
24 | Correct | 2 ms | 376 KB | Output is correct |
25 | Correct | 2 ms | 376 KB | Output is correct |
26 | Correct | 2 ms | 376 KB | Output is correct |
27 | Correct | 2 ms | 376 KB | Output is correct |
28 | Correct | 2 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 3 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 380 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Correct | 2 ms | 376 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |
11 | Correct | 2 ms | 376 KB | Output is correct |
12 | Correct | 2 ms | 376 KB | Output is correct |
13 | Correct | 2 ms | 376 KB | Output is correct |
14 | Correct | 2 ms | 376 KB | Output is correct |
15 | Correct | 2 ms | 376 KB | Output is correct |
16 | Correct | 2 ms | 376 KB | Output is correct |
17 | Correct | 2 ms | 376 KB | Output is correct |
18 | Correct | 2 ms | 376 KB | Output is correct |
19 | Correct | 2 ms | 376 KB | Output is correct |
20 | Correct | 2 ms | 376 KB | Output is correct |
21 | Correct | 3 ms | 376 KB | Output is correct |
22 | Correct | 3 ms | 376 KB | Output is correct |
23 | Correct | 3 ms | 504 KB | Output is correct |
24 | Correct | 3 ms | 376 KB | Output is correct |
25 | Correct | 3 ms | 504 KB | Output is correct |
26 | Correct | 3 ms | 504 KB | Output is correct |
27 | Correct | 3 ms | 376 KB | Output is correct |
28 | Correct | 3 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 632 KB | Output is correct |
2 | Correct | 5 ms | 632 KB | Output is correct |
3 | Correct | 18 ms | 1484 KB | Output is correct |
4 | Correct | 18 ms | 2512 KB | Output is correct |
5 | Correct | 9 ms | 1272 KB | Output is correct |
6 | Correct | 9 ms | 1272 KB | Output is correct |
7 | Correct | 16 ms | 2296 KB | Output is correct |
8 | Correct | 16 ms | 2296 KB | Output is correct |
9 | Correct | 8 ms | 1272 KB | Output is correct |
10 | Correct | 9 ms | 1272 KB | Output is correct |
11 | Correct | 20 ms | 2552 KB | Output is correct |
12 | Correct | 20 ms | 2640 KB | Output is correct |
13 | Correct | 10 ms | 1272 KB | Output is correct |
14 | Correct | 10 ms | 1272 KB | Output is correct |
15 | Correct | 15 ms | 2040 KB | Output is correct |
16 | Correct | 15 ms | 2040 KB | Output is correct |
17 | Correct | 18 ms | 2296 KB | Output is correct |
18 | Correct | 18 ms | 2296 KB | Output is correct |
19 | Correct | 19 ms | 2424 KB | Output is correct |
20 | Correct | 19 ms | 2424 KB | Output is correct |