| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 961789 | hirayuu_oj | Rice Hub (IOI11_ricehub) | C++17 | 2 ms | 860 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ricehub.h"
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(x) x.begin(),x.end()
using ll=long long;
const ll INF=1LL<<60;
int besthub(int R, int L, int X[], long long B){
vector<ll> cum(R+1,0);
vector<ll> x(R);
rep(i,R){
x[i]=X[i];
cum[i+1]=cum[i]+x[i];
}
ll ok=1,ng=R+1;
while(ng-ok>1){
ll mid=(ok+ng)>>1;
ll half=mid>>1;
bool can=0;
rep(i,R-mid+1){
ll lf=cum[i+half]-cum[i];
ll ri=cum[i+mid]-cum[i+half];
ll rs=0;
if(mid&1)rs-=R;
if(rs+ri-lf<=B){
can=1;
}
}
if(can)ok=mid;
else ng=mid;
}
return ok;
}
| # | 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... | ||||
