PJ T1 为何在牛客跑的全省分数文档里是二十分 但是单独在牛客网站提交是满分
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n;
ll sum(int x)
{
ll res=0;
for(int i=x;i>=0;i--)
res+=i;
return res;
}
ll mpow(int x)
{
ll res=1;
for(int i=1;i<=x;i++)
res*=2;
return res;
}
int main()
{
freopen("power.in","r",stdin);
freopen("power.out","w",stdout);
bool f=false;
cin>>n;
if(n%2!=0)
{
cout<<-1;
return 0;
}
int tot=log(n)/log(2);
vector <ll> res;
while(true)
{
res.push_back(mpow(tot));
n-=mpow(tot);
tot=log(n)/log(2);
if(n==0)
{
f=true;
break;
}
if(n==1) break;
}
if(f==false)
{
cout<<-1;
return 0;
}
for(int i=0;i<res.size();i++)
cout<<res[i]<<" ";
return 0;
//cout<<mpow(0);
}