Logo
(追記) (追記ここまで)

33787번 - Thomas 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB43322670.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

예제 출력 1

1
0

예제 입력 2

2

예제 출력 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$.

출처

University > Rutgers University > Rutgers University Programming Contest Spring 2025 A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /