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

6977번 - Pattern Generator 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB1871039256.790%

문제

Write a program that repeatedly reads two numbers n and k and prints all bit patterns of length n with k ones in descending order (when the bit patterns are considered as binary numbers).

입력

You may assume that 30 ≥ n > 0, 8 > k ≥ 0, and nk. The first number in the input gives the number of pairs n and k. The numbers n and k are separated by a single space. Leading zeroes in a bit pattern should be included. See the example below.

출력

제한

예제 입력 1

3
2 1
2 0
4 2

예제 출력 1

The bit patterns are
10
01
The bit patterns are
00
The bit patterns are
1100
1010
1001
0110
0101
0011

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 1996 > CCC 1996 3번

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

출처

대학교 대회

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

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