No.1264 010
Problem Statement
Consider the following operation on a string consisting only of 0 and 1 (a 01-string).
- If the string contains $010$ as a contiguous substring, replace the leftmost occurrence with $101$.
Repeat this until the string no longer contains $010$.
Find one 01-string $s$ of length at least $1$ and at most $1010$ for which the number of replacements until the operation stops is exactly $N$. (It can be proved that a solution always exists under this constraint.)
Input
$N$
- $N$ is an integer
- $0 \leq N \leq 1000$
Output
Output a 01-string of length at least $1$ and at most $1010$ that satisfies the condition.
Sample
Sample 1
Input
2
Output
010010
This is the example from the problem statement. If multiple solutions exist, you may output any of them.
Sample 2
Input
0
Output
1
Sample 3
Input
4
Output
00100100
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
stoq
ekaraage