제출 #230728

#제출 시각아이디문제언어결과실행 시간메모리
230728matir쌀 창고 (IOI11_ricehub)C++14
100 / 100
23 ms1792 KiB
#include<bits/stdc++.h> using namespace std; int besthub(int R, int L, int X[], long long B) { long long int bst = 0, cc = 0, nh = 1, mi = 0, li = 0, ri = 0; while(ri < R) { if(cc > B) { cc -= X[mi] - X[li]; ++li; if(nh & 1) ++mi; --nh; } else { bst = max(bst, nh); ++ri; cc += X[ri] - X[mi]; if(nh & 1) ++mi; ++nh; } } return bst; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...