7054.Binary Subsequences

Time Limit: 1s Memory Limit: 512MB

Your task is to find a minimum length bit string that has exactly $n$ distinct subsequences.

For example, a correct solution for $n=6$ is 101 whose distinct subsequences are 0 , 1 , 01 , 10 , 11 and 101 .

Input Format(From the terminal/stdin)

The only input line has an integer $n$ .

  • $1 \le n \le 10^6$

Output Format(To the terminal/stdout)

Print one bit string: a solution to the task. You can print any valid solution.

Sample Input

Copy
6
 \n

Sample Output special judge

Copy
101
   \n
Source: CSES, Additional Problems II, 2430

Submit

请先 登录

© 2025 FAQs