| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 530545 | Jesus | 쌀 창고 (IOI11_ricehub) | C++14 | 14 ms | 1716 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "ricehub.h"
using namespace std;
int besthub(int R, int L, int X[], long long B)
{
long long int precio=0,maximo=0;
int izq=0,der=0,cen=0;
int i=0,j=0;
int aux;
while(i<R){
if(j==R-1||precio>B){
if(precio<=B) maximo=max((long long int)j-i+1,maximo);
precio-=(X[cen]-X[i]);
i++;
aux=(i+j)/2;
if(aux>cen){
precio+=(X[aux]-X[cen])*(cen-i);
precio-=(X[aux]-X[cen])*(j-aux);
cen=aux;
}
}
else{
maximo=max(maximo,(long long int)(j-i)+1);
j++;
aux=(j+i)/2;
precio+=X[j]-X[aux];
if(aux>cen){
precio+=(X[aux]-X[cen])*(cen-i);
precio-=(X[aux]-X[cen])*(j-aux-1);
cen=aux;
}
}
}
return maximo;
}
컴파일 시 표준 에러 (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... | ||||
