| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1328698 | Mamikonm1 | 쌀 창고 (IOI11_ricehub) | C++17 | 0 ms | 344 KiB |
#include "ricehub.h"
#include<bits//stdc++.h>
using namespace std;
using ll = long long;
int besthub(int R, int L, int X[], long long B)
{
vector<ll>pf(R);
pf[0]=X[0];
int ans=0;
for(int i=1;i<R;++i)pf[i]=pf[i-1]+X[i];
auto sum=[&](int l,int r)->ll{
if(l>r)return 0;
if(r>=R)return 0;
return pf[r]-(l?pf[l-1]:0);
};
for(int i=0;i<R;++i){
for(int j=i;j<R;++j){
for(int k=j+1;k<R;++k){
for(int l=X[j];l<=X[j+1];++l){
if((j-i+1)*1ll*l-sum(i,j)+sum(j+1,k)-(k-j)*1ll*l<=B){
ans=max(ans,k-i+1);
// cout<<i<<' '<<j<<' '<<k<<' '<<l<<'\n';
break;
}
}
}
}
}
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... | ||||
