Submission #31241

# Submission time Handle Problem Language Result Execution time Memory
31241 2017-08-15T11:53:16 Z 14kg Rice Hub (IOI11_ricehub) C++11
0 / 100
3 ms 5020 KB
#include "ricehub.h"
#define f(x,y) (long long)(in[y+1]-in[(x+y)/2+(y-x+1)%2])

int besthub(int n, int max_L, int in[], long long B){
    int x=0, y=0, out=0;
    long long sum=0;

    while(x<n){
        while(y+1<n && sum+f(x,y)<=B) sum+=f(x,y), y++;
        out=out>y-x+1?out:y-x+1;
        sum-=in[(x+y)/2+((y-x+1)%2?0:1)]-in[x], x++;
    } return out;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 5020 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 5020 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 5020 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 5020 KB Output isn't correct
2 Halted 0 ms 0 KB -