← All problemsSign in

Priority Customers (Hard)

CodeChefRating 3168Open on judge ↗

**This is the hard version of the problem. Here, you need to compute the number of valid subsets of each size. The constraints are the same as the easy version.** $N$ people stand in line to enter your store. Some of them are priority customers, though you don't know which ones yet. Their initial order is $[1, 2, 3, \ldots, N]$. You can change the order of people by doing the following: Call

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