← All problemsSign in

Combinatorial Numbers

CodeChefRating 2298Open on judge ↗

Read problems statements in Russian here Chef has a special affection for sets of binary strings of equal length which have same numbers of 1's. Given three integers n, k and m, your task is to find the the lexicographically mth smallest string among strings which have length n and have k 1's. If no such string exists output -1. Tips: To see what lexicographic order means . See http://en.wikipe

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start