This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
#define maxn 300
typedef long long lld;
lld t, dy[303], mx;
int mi, ba[303], n;
int main(){
int i, j, a;
dy[0]=1;
scanf("%d", &t);
if(t==1){
printf("1 1\n1");
return 0;
}
for(i=0;; i++){
mx=0, mi=0;
for(j=0; j<=maxn; j++){
if(mx<dy[j] && dy[j]<=t)mx=dy[j];
if(mx==dy[j])mi=j;
}
if(mx==t)break;
if(mi==0)a=1;
else{
for(a=1; a<=mi; a++){
if(dy[mi]+dy[mi-a]<=t)break;
}
}
ba[i]=a;
for(j=maxn; j>=a; j--){
if(dy[j]<=t)dy[j]+=dy[j-a];
}
}
n=i;
printf("%d %d\n", n, mi);
for(i=0; i<n; i++)printf("%d ", ba[i]);
return 0;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |