Submission #5038

#TimeUsernameProblemLanguageResultExecution timeMemory
5038cki86201Rice Hub (IOI11_ricehub)C++98
100 / 100
20 ms5776 KiB
typedef long long ll; ll S[100010]; #define get(s,m,d) (S[(d)]-S[(m)]+X[(m)]*(2*(m)-(s)-(d))-S[(m)-1]+S[(s)-1]) int besthub(int R,int L,int *X,ll B) { int i,j,a=0; for(i=R;i;i--)X[i]=X[i-1]; for(i=1;i<=R;i++)S[i]=S[i-1]+X[i]; for(i=j=1;i<=R;i++){ while(j<i&&get(j,(j+i)>>1,i)>B)j++; a=a>i-j?a:i-j; } return a+1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...