Submission #201232

# Submission time Handle Problem Language Result Execution time Memory
201232 2020-02-10T00:37:11 Z DavidDamian Rice Hub (IOI11_ricehub) C++11
100 / 100
60 ms 1784 KB
#include "ricehub.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define debug(x) cout<<#x<<" = "<<x<<endl
int besthub(int N, int L, int X[], ll B)
{
    ll cost=0;
    int a=0,b=0;
    int maximum=0;
    while(b<N){
        int mid;
        if(cost<=B){
            maximum=max(maximum,b-a+1);
            b++;
            mid=(a+b)/2;
            if(b<N)
                cost+=X[b]-X[mid];
        }
        else{
            a++;
            mid=(a+b)/2;
            cost-=X[mid]-X[a-1];
        }
    }
    return maximum;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 364 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Correct 5 ms 256 KB Output is correct
8 Correct 5 ms 256 KB Output is correct
9 Correct 5 ms 376 KB Output is correct
10 Correct 5 ms 376 KB Output is correct
11 Correct 5 ms 376 KB Output is correct
12 Correct 5 ms 256 KB Output is correct
13 Correct 5 ms 256 KB Output is correct
14 Correct 5 ms 376 KB Output is correct
15 Correct 5 ms 256 KB Output is correct
16 Correct 5 ms 376 KB Output is correct
17 Correct 5 ms 256 KB Output is correct
18 Correct 5 ms 376 KB Output is correct
19 Correct 5 ms 376 KB Output is correct
20 Correct 5 ms 256 KB Output is correct
21 Correct 5 ms 256 KB Output is correct
22 Correct 5 ms 256 KB Output is correct
23 Correct 5 ms 376 KB Output is correct
24 Correct 5 ms 376 KB Output is correct
25 Correct 5 ms 376 KB Output is correct
26 Correct 5 ms 376 KB Output is correct
27 Correct 5 ms 376 KB Output is correct
28 Correct 5 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Correct 5 ms 376 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 376 KB Output is correct
10 Correct 5 ms 376 KB Output is correct
11 Correct 5 ms 376 KB Output is correct
12 Correct 5 ms 376 KB Output is correct
13 Correct 5 ms 376 KB Output is correct
14 Correct 5 ms 376 KB Output is correct
15 Correct 5 ms 376 KB Output is correct
16 Correct 5 ms 376 KB Output is correct
17 Correct 5 ms 376 KB Output is correct
18 Correct 5 ms 376 KB Output is correct
19 Correct 5 ms 376 KB Output is correct
20 Correct 5 ms 376 KB Output is correct
21 Correct 5 ms 376 KB Output is correct
22 Correct 5 ms 376 KB Output is correct
23 Correct 5 ms 376 KB Output is correct
24 Correct 5 ms 376 KB Output is correct
25 Correct 6 ms 376 KB Output is correct
26 Correct 5 ms 376 KB Output is correct
27 Correct 6 ms 376 KB Output is correct
28 Correct 6 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 632 KB Output is correct
2 Correct 8 ms 504 KB Output is correct
3 Correct 23 ms 1764 KB Output is correct
4 Correct 25 ms 1784 KB Output is correct
5 Correct 12 ms 888 KB Output is correct
6 Correct 12 ms 888 KB Output is correct
7 Correct 20 ms 1528 KB Output is correct
8 Correct 21 ms 1528 KB Output is correct
9 Correct 12 ms 760 KB Output is correct
10 Correct 12 ms 760 KB Output is correct
11 Correct 24 ms 1784 KB Output is correct
12 Correct 24 ms 1784 KB Output is correct
13 Correct 13 ms 888 KB Output is correct
14 Correct 13 ms 888 KB Output is correct
15 Correct 19 ms 1400 KB Output is correct
16 Correct 19 ms 1400 KB Output is correct
17 Correct 22 ms 1656 KB Output is correct
18 Correct 22 ms 1652 KB Output is correct
19 Correct 22 ms 1656 KB Output is correct
20 Correct 60 ms 1784 KB Output is correct