| 比赛 | 20130923 | 评测结果 | AAAAAAAAAA |
|---|---|---|---|
| 题目名称 | 鬼谷子的钱袋 | 最终得分 | 100 |
| 用户昵称 | 农场主 | 运行时间 | 0.003 s |
| 代码语言 | C++ | 内存使用 | 0.31 MiB |
| 提交时间 | 2015-10-12 20:41:14 | ||
#include<cstdio>
#include<vector>
using namespace std;
vector<int> s;
long long ans=0,sum,i,j,h,n;
int main()
{
freopen("wallet.in","r",stdin);
freopen("wallet.out","w",stdout);
scanf("%d",&n);
while (n)
{
s.push_back(int(double(n)/2+0.5));
ans++;
n=n/2;
}
printf("%d\n",ans);
for (int i=s.size()-1;i>=0;i--) printf("%d %",s[i]);
}