| 记录编号 | 421858 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1306.[HNOI 2006]鬼谷子的钱袋 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.002 s | ||
| 提交时间 | 2017-07-08 11:11:05 | 内存使用 | 0.31 MiB | ||
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;
int n,p;
void search(int x,int y){
if(x!=1) search(x/2,y+1);
printf("%d ",x-x/2);
}
int main(){
freopen("wallet.in","r",stdin);
freopen("wallet.out","w",stdout);
scanf("%d",&n);
for (p=0;(1<<p)<n;++p);
printf("%d\n",p);
search(n,0);
}