From fff8697e472cae2c3b677a864807ef7375d683af Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Fri, 13 Nov 2020 18:29:30 +0800 Subject: [PATCH] =?UTF-8?q?P7071=20=E4=BC=98=E7=A7=80=E7=9A=84=E6=8B=86?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R41824043 --- problem/P7071/P7071.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 problem/P7071/P7071.cpp diff --git a/problem/P7071/P7071.cpp b/problem/P7071/P7071.cpp new file mode 100644 index 00000000..86f69380 --- /dev/null +++ b/problem/P7071/P7071.cpp @@ -0,0 +1,19 @@ +#include + +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; +}