Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
28830 | wxk123 | 优秀的拆分 CSP2020 J组 | C++ | 通过 | 0 MS | 248 KB | 353 | 2023-10-03 10:44:00 |
#include"bits/stdc++.h" using namespace std; int m[30]={8388608 ,4194304 ,2097152,1048576,524288,262144,131072,65536,32768,16384,8192,4096,2048,1024,512,256,128,64,32,16,8,4,2}, n; int main(){ cin>>n; if(n%2!=0)cout<<-1; else{ int h=0; while(n>0){ if(n>=m[h]){ cout<<m[h]<<' '; n-=m[h]; }h++; } } return 0; }