| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 228397 | tushar_2658 | 쌀 창고 (IOI11_ricehub) | C++14 | 109 ms | 708 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ricehub.h"
#include "bits/stdc++.h"
using namespace std;
const int maxn = 100005;
using ll = long long;
int a[maxn];
ll lim;
vector<ll> p;
int n;
int besthub(int R, int L, int X[], long long B)
{
n = R;
lim = B;
p.resize(R);
for(int i = 0; i < R; ++i){
a[i] = X[i];
}
sort(a, a + R);
for(int i = 0; i < R; ++i){
if(i == 0){
p[i] = a[i];
}else {
p[i] = p[i - 1] + a[i];
}
}
int ans = 0;
for(int i = 0; i < n; ++i){
ll mid = a[i];
int l = i, r = i;
ll left = B;
int done = 1;
while(left > 0 && r < n && l >= 0){
ll nxt_l = LLONG_MAX;
if(l > 0){
nxt_l = a[l] - a[l - 1];
}
ll nxt_r = LLONG_MAX;
if(r < n - 1){
nxt_r = a[r + 1] - a[r];
}
if(nxt_l < nxt_r){
done++;
left -= nxt_l;
if(left < 0){
done--;
break;
}
--l;
}else {
done++;
left -= nxt_r;
if(left < 0){
done--;
break;
}
++r;
}
}
ans = max(ans, done);
}
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... | ||||
