#abc234c. C - Happy New Year!
C - Happy New Year!
Score : points
问题陈述
在以10进制表示的正整数中,仅包含数字0和2的那些数中,找出第K小的整数。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Among the positive integers that consist of 's and 's when written in base , find the -th smallest integer.
Constraints
- is an integer between and (inclusive).
Input
Input is given from Standard Input in the following format:
Output
Print the answer as an integer.
Here, the exact value must be printed as an integer, even if it is big. Exponential notations such as 2.34e+22
, for example, or unnecessary leading zeros such as 0523
are not allowed.
Sample Input 1
3
Sample Output 1
22
The positive integers that consist of 's and 's when written in base are in ascending order.
The -rd of them, which is , should be printed.
Sample Input 2
11
Sample Output 2
2022
Sample Input 3
923423423420220108
Sample Output 3
220022020000202020002022022000002020002222002200002022002200
Note that the exact value of the answer must be printed as an integer, even if it is big.
update @ 2024/3/10 10:09:56