| 比赛 | 20130923 | 评测结果 | AAAAAAAAAA |
|---|---|---|---|
| 题目名称 | 鬼谷子的钱袋 | 最终得分 | 100 |
| 用户昵称 | forever | 运行时间 | 0.002 s |
| 代码语言 | C++ | 内存使用 | 0.29 MiB |
| 提交时间 | 2015-10-12 19:00:50 | ||
#include<cstdio>
#include<cmath>
using namespace std;
int n;
void print(int x,int y){
if(x==1) ;
else
print(x/2,y+1);
printf("%d ",x-x/2);
}
int main(){
freopen("wallet.in","r",stdin);
freopen("wallet.out","w",stdout);
scanf("%d",&n);
printf("%d\n",(int)(log2(n))+1);
print(n,0);
}