| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 43 | 32 | 26 | 70.270% |
You are given an integer $n$. Find the largest set of distinct binary strings of length $n$ such that no two strings in the set differ at exactly one index.
For example, for $n=5,ドル the strings 10001ドル$ and 11001ドル$ could not both be in the set, because they only differ in their second positions.
The first and only line of the input contains one integer $n$ (1ドル \leq n \leq 15$) --- the size of the binary strings in the set.
The first line of output should contain a single integer $k$ (0ドル \leq k \leq 2^n$) --- the number of strings in your set.
Each of the next $k$ lines should contain a single binary string of size $n$ --- one of the strings in your set. No two of these strings should be equal, or differ in exactly one position.
If there are multiple solutions, you may print any.
1
1 0
2
2 00 11
In the first sample case, we choose the set $\{0\},ドル and in the second sample case, we choose the set $\{00, 11\}$. Neither of these sets contain two strings that differ in exactly one position, and we can show that they are both of maximal size for their given $n$.