# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
522295 | new_acc | 쌀 창고 (IOI11_ricehub) | C++14 | 16 ms | 2500 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(a, b) for(int a = 0; a < (int)(b); a++)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int N=1e5+10;
ll sp[N];
bool check(int i,int j,ll b){
int il=(j-i+1)/2;
ll xd=sp[i+il-1]-(i==0?0:sp[i-1]);
ll xd2=sp[j]-(j-il<0?0:sp[j-il]);
return (xd2-xd)<=b;
}
int bs(int pocz,int kon,ll b){
int p=pocz;
int sr,res;
while(pocz<=kon){
sr=(pocz+kon)/2;
if(check(p,sr,b)) res=sr,pocz=sr+1;
else kon=sr-1;
}
return res;
}
int besthub(int n,int l,int t[],ll b){
int ans=0;
sp[0]=t[0];
for(int i=1;i<n;i++) sp[i]+=sp[i-1]+t[i];
rep(i,n) ans=max(ans,bs(i,n-1,b)-i+1);
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... |