| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1327834 | arman.khachatryan | 쌀 창고 (IOI11_ricehub) | C++20 | 0 ms | 332 KiB |
#include <bits/stdc++.h>
using namespace std;
long long besthub(int r, int l, int* a, long long b){
int pref[r];
pref[0]=a[0];
for(int i=1; i<r; i++){
pref[i]=pref[i-1]+a[i];
}
int j=0, cur, ans=0;
for(int i=0; i<r; i++){
int mid=(i+j)/2;
cur=(mid-j+1)*a[mid]-(pref[mid-1]-pref[j-1]);
cur+=pref[i]-pref[mid]-(r+1-mid)*a[mid];
if(cur>b){
j++;
i--;
}else{
ans=max(cur, ans);
}
}
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... | ||||
