| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1318674 | Agageldi | 쌀 창고 (IOI11_ricehub) | C++20 | 1 ms | 332 KiB |
#include "bits/stdc++.h"
#include "ricehub.h"
// #include "grader.cpp"
using namespace std;
const int inf = 1e18;
int besthub(int R, int L, int X[], long long B) {
set <int> v = {0};
for(int i = 0; i < R; i++) {
v.insert(X[i]);
}
int ans = 0;
for(int i = 1; i <= L; i++) {
auto r = v.upper_bound(i);
auto l = r;
if(l != v.begin()) l--;
int jog = 0, B1 = B;
while(r != v.end() || l != v.begin()) {
int x1 = inf, x2 = inf;
if(r != v.end()) x1 = abs(i - (*r));
if(l != v.begin()) x2 = abs(i - (*l));
if(min(x1,x2) > B1) break;
B1 -= min(x1, x2);
if(x1 <= x2) {
jog++;
r++;
}
else {
jog++;
l--;
}
}
ans = max(ans,jog);
}
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... | ||||
