# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
55836 | leejseo | 쌀 창고 (IOI11_ricehub) | C++98 | 1092 ms | 544 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ricehub.h"
#include <algorithm>
using namespace std;
long long S[1000001];
inline long long val(int i){
return i<0? 0 : S[i];
}
inline long long cost(int i, int j, int X[]){
int mid = i+j >> 1;
long long left = val(mid) * (mid - i + 1) - (val(mid) - val(i-1));
long long right = val(j) - val(mid-1) - (val(mid) * (j - mid + 1));
return left + right;
}
int besthub(int R, int L, int X[], long long B){
S[0] = X[0];
for (int i=1; i<R; i++) S[i] = S[i-1] + X[i];
int ans = 0;
int i=0, j=0;
while (i < R && j < R){
if (cost(i, j, X) > B){
i++;
continue;
}
ans = max(ans, j-i+1);
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |