AC

许许  •  4天前


include <bits/stdc++.h> using namespace std;

int main() { freopen("power.in", "r", stdin); freopen("power.out", "w", stdout); int n; cin >> n; if (n % 2 != 0) { printf("-1"); return 0; } else { while (n > 0) { long long p = 1; while (2 p <= n) { p = p 2; } cout << p << " "; n -= p; } } return 0; }


评论:

请先登录,才能进行评论