#P6124. [NEERC 2015] Binary vs Decimal

    ID: 5097 远端评测题 2000ms 128MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>高精度2015广度优先搜索,BFSACM_ICPC

[NEERC 2015] Binary vs Decimal

Description

A positive number AA is considered valid if it contains only 0 or 1, and after converting it to binary as BB, AA is a suffix of BB.

Now you are given a number NN. Find the NN-th such number.

Input Format

One line with one number NN.

Output Format

One line with one number: the NN-th number.

2
10
10
1100

Hint

1N1041 \le N \le 10^4.

Original Binary Comment
11
1010 10101010
1111 10111011
100100 11001001100100
101101 11001011100101
110110 11011101101110
111111 11011111101111
10001000 11111010001111101000
10011001 11111010011111101001
10101010 11111100101111110010 ×
10111011 11111100111111110011
11001100 1000100110010001001100

Translated by ChatGPT 5