Count Distinct Sets
CodeChefOpen on judge ↗
Alice writes a permutation P1, P2, P3, … PN of [1, 2, 3, … N] that follows the condition: Pi > Pi/2 for all i = 2 to N, is assumed to be an ‘amusing’ permutation. Note that ‘/’ denotes integer division. Alice wrote down all ‘amusing’ permutations on a sheet of paper. For each number from i = 1 to N, she defines a set Si. A number j belongs to Si if number i was at jth position in at-least one
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.
Sign in to chat with the tutor and save your progress.
Sign in to start