# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
28879 | aybala | 쌀 창고 (IOI11_ricehub) | C++11 | 1000 ms | 5020 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ricehub.h"
int besthub(int R, int L, int X[], long long B)
{
/*int i,j,k,l;
int xx[103];
for(i=1;i<=L;i++){
xx[i]=0;
}
for(i=0;i<R;i++){
xx[X[i]]++;
}
int ans=0;
for(i=1;i<=L;i++){
long long top=0,say=0;
for(j=i-1;j>=1;j--){
for(k=i;k<=L;k++){
top=0,say=0;
for(l=i; l>=j; l--){
top+=(long long)(i-l)*xx[l];
say+=xx[l];
}
for(l=i; l<=k; l++){
top+=(long long)(l-i)*xx[l];
say+=xx[l];
}
if(top<=B && say>ans)
ans=say;
}
}
if(top<=B && say>ans)
ans=say;
}*/
int i,j,k,l;
int ric[10003];
for(i=1;i<10003;i++){
ric[i]=0;
}
for(i=0;i<R;i++){
ric[X[i]]++;
}
int ans=0,anss=0;
for(i=1;i<=L;i++){
for(j=i;j>=1;j--){
for(k=i;k<=L;k++){
long long top=0;
int say=0;
for(l=i-1;l>=j;l--){
top+=(long long)(i-l)*ric[l];
say+=ric[l];
if(top>B)
break;
}
for(l=i;l<=k;l++){
top+=(long long)(l-i)*ric[l];
say+=ric[l];
if(top>B)
break;
}
if(top<=B && say>ans){
ans=say;
}
}
}
}
R=ans;
return R;
}
컴파일 시 표준 에러 (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... |