mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-24 01:28:49 +00:00
P7071 优秀的拆分
R41824043
This commit is contained in:
parent
d25daeb466
commit
fff8697e47
19
problem/P7071/P7071.cpp
Normal file
19
problem/P7071/P7071.cpp
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user