Generation of Combinatorial Objects · Generating Subsets

Lesson 8

Nikolai Chukhin · Alexander S. Kulikov

Programming problem.

Write a program that reads two integers \(1 \le k \le n \le 8\) and outputs all binary subsets of size \(k\) of the set \(\{0,1,\dotsc,n-1\}\). Output each subset in ascending order.

5 points
Public samples
Public sample 1
Input
1 1
Expected output
0