| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1327713 | arman.khachatryan | 쌀 창고 (IOI11_ricehub) | C++20 | 1094 ms | 332 KiB |
#include <bits/stdc++.h>
using namespace std;
long long besthub(int r, int l, int* a, long long b){
int j, k, ans=0, cnt;
long long c;
bool bl;
for(int i=0; i<r; i++){
j=i-1;
k=i+1;
cnt=1;
c=b;
bl=true;
while(c>0 && bl){
if(0<=j && (k>=r || a[i]-a[j]<=a[k]-a[i])){
if(c<a[i]-a[j]){
bl=false;
continue;
}
c-=(a[i]-a[j])*1LL;
j--;
cnt++;
}else if(k<r && (j<0 || a[i]-a[j]>=a[k]-a[i]) ){
if(c<a[k]-a[i]){
bl=false;
continue;
}
c-=(a[k]-a[i])*1LL;
k++;
cnt++;
}
}
ans=max(ans, cnt);
}
return ans;
}| # | 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... | ||||
