Submission #16401

#TimeUsernameProblemLanguageResultExecution timeMemory
16401cometRice Hub (IOI11_ricehub)C++98
100 / 100
28 ms4988 KiB
typedef long long ll; int max(int x,int y){return x>y?x:y;} int besthub(int N, int Eyfa, int X[], long long B){ X[N]=X[N-1]; int l=0,r=0,mid=0,ret=0; ll sum=0; bool ok=0; while(r<N){ while(r<N&&sum<=B){ if(ok)mid++; r++; sum+=X[r]-X[mid]; ok=!ok; ret=max(ret,r-l); } while(sum>B){ if(ok)mid++; sum-=X[mid]-X[l]; l++; ok=!ok; } } return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...