Submission #1109905

# Submission time Handle Problem Language Result Execution time Memory
1109905 2024-11-08T03:24:50 Z ozner77 Rice Hub (IOI11_ricehub) C++17
100 / 100
12 ms 4176 KB
#include <bits/stdc++.h>
using namespace std;
int besthub(int R,int L,int X[],long long B){
    vector<long long> p(R+1,0);
    for(int i=0;i<R;i++){
        p[i+1]=p[i]+X[i];
    }
    long long ri=0,res=1;
    for(int le=0;le<R;le++){
        while(ri<R){
            long long mid=(le+ri+1)/2,q=0;
            if((le+ri+1)%2!=0){
                q-=X[mid];
            }
            q-=p[mid]-p[le];
            q+=p[ri+1]-p[mid];
            if(q>B){
                break;
            }
            ri++;
        }
        res=max(res,ri-le);
        if(ri==R){
            break;
        }
    }
    return res;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 504 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 504 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 2 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 504 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 508 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 1 ms 336 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 508 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 1 ms 336 KB Output is correct
22 Correct 1 ms 336 KB Output is correct
23 Correct 1 ms 336 KB Output is correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 1 ms 336 KB Output is correct
26 Correct 1 ms 336 KB Output is correct
27 Correct 1 ms 336 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 504 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 1 ms 336 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 504 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 1 ms 336 KB Output is correct
22 Correct 1 ms 336 KB Output is correct
23 Correct 1 ms 592 KB Output is correct
24 Correct 2 ms 336 KB Output is correct
25 Correct 2 ms 336 KB Output is correct
26 Correct 1 ms 336 KB Output is correct
27 Correct 1 ms 336 KB Output is correct
28 Correct 2 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 592 KB Output is correct
2 Correct 3 ms 760 KB Output is correct
3 Correct 12 ms 4176 KB Output is correct
4 Correct 10 ms 3356 KB Output is correct
5 Correct 5 ms 2896 KB Output is correct
6 Correct 6 ms 3408 KB Output is correct
7 Correct 8 ms 3288 KB Output is correct
8 Correct 10 ms 3408 KB Output is correct
9 Correct 4 ms 2896 KB Output is correct
10 Correct 5 ms 2896 KB Output is correct
11 Correct 10 ms 3408 KB Output is correct
12 Correct 9 ms 3580 KB Output is correct
13 Correct 5 ms 2896 KB Output is correct
14 Correct 5 ms 2896 KB Output is correct
15 Correct 8 ms 3060 KB Output is correct
16 Correct 9 ms 3152 KB Output is correct
17 Correct 9 ms 3152 KB Output is correct
18 Correct 9 ms 3152 KB Output is correct
19 Correct 12 ms 4176 KB Output is correct
20 Correct 10 ms 3408 KB Output is correct