#P1010. [NOIP 1998 普及组] 幂次方
[NOIP 1998 普及组] 幂次方
Description
Any positive integer can be expressed as a sum of powers of . For example, .
We also agree to write exponents using parentheses, i.e., can be written as .
Thus, can be written as .
Furthermore, (where is written as ), and .
Therefore, the final expression for is .
Another example: .
Thus, the final expression for is .
Input Format
One line containing a positive integer .
Output Format
Output the agreed "0, 2" representation of (no spaces are allowed in the expression).
1315
2(2(2+2(0))+2)+2(2(2+2(0)))+2(2(2)+2(0))+2+2(0)
Hint
- Constraints: For of the testdata, .
- NOIP 1998 Junior, Problem 3.
Translated by ChatGPT 5
京公网安备 11011102002149号