Implementing Solutions for CSP 2020 Problems
Power Decomposition Given an integer n, output its representation as a sum of distinct powers of two in descending order, or -1 if n is odd. #include <iostream> using namespace std; int main() { int val; cin >> val; if (val % 2 != 0) { cout << "-1"; return 0; } for (int e...