# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
285029 | Bill_00 | 쌀 창고 (IOI11_ricehub) | C++14 | 1096 ms | 640 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ricehub.h"
#include <bits/stdc++.h>
using namespace std;
#define MAX_R 1000000
int besthub(int R, int L, int a[], long long B)
{
int dp[100001];
dp[0]=0;
for(int i=1;i<R;i++){
dp[i]=dp[i-1]+a[i]-a[0];
}
int l=1,r=R;
while(l!=r){
int mid=l+r>>1,flag=0;
for(int i=mid-1;i<R;i++){
int MID=i+i+1-mid>>1;
int left=i+1-mid;
int cost=dp[i]-dp[MID]-((i-MID)*(a[MID]-a[0]))+((a[MID]-a[left])*(MID-left+1)-(dp[MID]-dp[left]-(MID-left)*(a[left]-a[0])));
if(cost<=B){
flag++;
break;
}
}
if(flag==0) r=mid;
else l=mid;
}
return l;
}
컴파일 시 표준 에러 (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... |