atcoder#ARC127C. [ARC127C] Binary Strings
[ARC127C] Binary Strings
Score : points
Problem Statement
Snuke has written on a blackboard every integer from through , in binary.
Find the -th lexicographically smallest string when seeing the integers on the blackboard as strings.
Here, the input gives in decimal, but in binary.
Constraints
- is in binary.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
3
101
11
The strings written on the blackboard in lexicographical order are 1
, 10
, 100
, 101
, 11
, 110
, 111
.
Additionally, we have .
Thus, the answer is 11
.
10
10100011
1001001111
1000000
11111
1000000000000000000000000000000