记录编号 192428 评测结果 AAAAAAAAAA
题目名称 [HNOI 2006]鬼谷子的钱袋 最终得分 100
用户昵称 Gravatarforever 是否通过 通过
代码语言 C++ 运行时间 0.002 s
提交时间 2015-10-10 21:44:28 内存使用 0.29 MiB
显示代码纯文本
#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);
	getchar();getchar();
}