제출 #582435

#제출 시각아이디문제언어결과실행 시간메모리
582435Mystic03쌀 창고 (IOI11_ricehub)C++17
0 / 100
2 ms456 KiB
#include <vector> #include <iostream> #define int long long using namespace std; int32_t besthub(int32_t n, int32_t L, int32_t X[], long long B){ int from = 0; int to = 0; long long cost = 0; int res = 1; while (true) { int currRange = to - from + 1; to++; if (to >= n) break; int newDist = X[to] - X[to - 1]; cost += (long long)currRange * newDist; while (cost > B) { cost -= X[to] - X[from]; from++; } res = max(res, to - from + 1); } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...