0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

P7071 优秀的拆分

R41824043
This commit is contained in:
Baoshuo Ren 2020-11-13 18:29:30 +08:00 committed by Baoshuo Ren
parent d25daeb466
commit fff8697e47
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

19
problem/P7071/P7071.cpp Normal file
View File

@ -0,0 +1,19 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n & 1) {
cout << -1 << endl;
}
else {
for (int i = 24; i > 0; i--) {
if (n >> i & 1) {
cout << (1 << i) << ' ';
}
}
}
return 0;
}