tj
2025-10-12 17:57:09
发布于:广东
0阅读
0回复
0点赞
#include<iostream>
#include<cmath>
#include<algorithm>
#include<queue>
#include<stack>
#include<vector>
#include<cstdio>
#include<unordered_map>
#define ll long long
using namespace std;
ll n;
int main() {
cin>>n;
if(n%2) {
cout<<-1;
return 0;
}
ll x=1;
while(x*2<=n) x*=2;
while(n) {
if(x<=n) {
cout<<x<<" ";
n-=x;
}
else x/=2;
}
}
这里空空如也




有帮助,赞一个