# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
20806 | 2017-02-16T08:15:39 Z | jjwdi0 | 쌀 창고 (IOI11_ricehub) | C++11 | 23 ms | 5680 KB |
#include "ricehub.h" #define MAX_N 100005 typedef long long ll; int max(int X, int Y){return X>Y?X:Y;} int besthub(int R, int L, int X[], ll B) { int ans = 0; int i = 1, j = 1; ll cnt = 0LL, A[MAX_N]; for(int i=R-1; i>=0; i--) X[i+1] = X[i]; A[0] = 0LL; for(int i=1; i<=R; i++) A[i] = A[i-1] + X[i]; while(i <= R && j <= R) { int mid = i + j >> 1; while(X[(i+j)/2] * (ll)((i+j)/2 - i + 1) - (A[(i+j)/2] - A[i-1]) + A[j] - X[(i+j)/2] * (ll)(j - (i+j)/2 + 1) - A[(i+j)/2 - 1] > B && i < j) i++; ans = max(ans, j - i + 1); j++; } return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 5676 KB | Output is correct |
2 | Correct | 0 ms | 5676 KB | Output is correct |
3 | Correct | 0 ms | 5676 KB | Output is correct |
4 | Correct | 0 ms | 5676 KB | Output is correct |
5 | Correct | 0 ms | 5680 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 5680 KB | Output is correct |
2 | Correct | 0 ms | 5672 KB | Output is correct |
3 | Correct | 0 ms | 5680 KB | Output is correct |
4 | Correct | 0 ms | 5676 KB | Output is correct |
5 | Correct | 0 ms | 5680 KB | Output is correct |
6 | Correct | 0 ms | 5676 KB | Output is correct |
7 | Correct | 0 ms | 5676 KB | Output is correct |
8 | Correct | 0 ms | 5672 KB | Output is correct |
9 | Correct | 0 ms | 5672 KB | Output is correct |
10 | Correct | 0 ms | 5676 KB | Output is correct |
11 | Correct | 0 ms | 5676 KB | Output is correct |
12 | Correct | 0 ms | 5676 KB | Output is correct |
13 | Correct | 0 ms | 5680 KB | Output is correct |
14 | Correct | 0 ms | 5672 KB | Output is correct |
15 | Correct | 0 ms | 5676 KB | Output is correct |
16 | Correct | 0 ms | 5680 KB | Output is correct |
17 | Correct | 0 ms | 5672 KB | Output is correct |
18 | Correct | 0 ms | 5676 KB | Output is correct |
19 | Correct | 0 ms | 5672 KB | Output is correct |
20 | Correct | 0 ms | 5680 KB | Output is correct |
21 | Correct | 0 ms | 5676 KB | Output is correct |
22 | Correct | 0 ms | 5676 KB | Output is correct |
23 | Correct | 0 ms | 5672 KB | Output is correct |
24 | Correct | 0 ms | 5672 KB | Output is correct |
25 | Correct | 0 ms | 5676 KB | Output is correct |
26 | Correct | 0 ms | 5676 KB | Output is correct |
27 | Correct | 0 ms | 5676 KB | Output is correct |
28 | Correct | 0 ms | 5676 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 5672 KB | Output is correct |
2 | Correct | 0 ms | 5676 KB | Output is correct |
3 | Correct | 0 ms | 5672 KB | Output is correct |
4 | Correct | 0 ms | 5680 KB | Output is correct |
5 | Correct | 0 ms | 5672 KB | Output is correct |
6 | Correct | 0 ms | 5676 KB | Output is correct |
7 | Correct | 0 ms | 5672 KB | Output is correct |
8 | Correct | 0 ms | 5672 KB | Output is correct |
9 | Correct | 0 ms | 5676 KB | Output is correct |
10 | Correct | 0 ms | 5676 KB | Output is correct |
11 | Correct | 0 ms | 5672 KB | Output is correct |
12 | Correct | 0 ms | 5676 KB | Output is correct |
13 | Correct | 0 ms | 5672 KB | Output is correct |
14 | Correct | 0 ms | 5676 KB | Output is correct |
15 | Correct | 0 ms | 5676 KB | Output is correct |
16 | Correct | 0 ms | 5676 KB | Output is correct |
17 | Correct | 0 ms | 5676 KB | Output is correct |
18 | Correct | 0 ms | 5672 KB | Output is correct |
19 | Correct | 0 ms | 5680 KB | Output is correct |
20 | Correct | 0 ms | 5676 KB | Output is correct |
21 | Correct | 0 ms | 5672 KB | Output is correct |
22 | Correct | 0 ms | 5676 KB | Output is correct |
23 | Correct | 0 ms | 5680 KB | Output is correct |
24 | Correct | 0 ms | 5676 KB | Output is correct |
25 | Correct | 0 ms | 5672 KB | Output is correct |
26 | Correct | 0 ms | 5680 KB | Output is correct |
27 | Correct | 0 ms | 5676 KB | Output is correct |
28 | Correct | 0 ms | 5676 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 5676 KB | Output is correct |
2 | Correct | 3 ms | 5680 KB | Output is correct |
3 | Correct | 16 ms | 5676 KB | Output is correct |
4 | Correct | 23 ms | 5672 KB | Output is correct |
5 | Correct | 9 ms | 5672 KB | Output is correct |
6 | Correct | 6 ms | 5672 KB | Output is correct |
7 | Correct | 13 ms | 5680 KB | Output is correct |
8 | Correct | 16 ms | 5676 KB | Output is correct |
9 | Correct | 6 ms | 5672 KB | Output is correct |
10 | Correct | 3 ms | 5676 KB | Output is correct |
11 | Correct | 13 ms | 5680 KB | Output is correct |
12 | Correct | 19 ms | 5676 KB | Output is correct |
13 | Correct | 6 ms | 5680 KB | Output is correct |
14 | Correct | 6 ms | 5676 KB | Output is correct |
15 | Correct | 16 ms | 5680 KB | Output is correct |
16 | Correct | 13 ms | 5676 KB | Output is correct |
17 | Correct | 13 ms | 5676 KB | Output is correct |
18 | Correct | 9 ms | 5676 KB | Output is correct |
19 | Correct | 19 ms | 5676 KB | Output is correct |
20 | Correct | 16 ms | 5676 KB | Output is correct |