Playing Cards
CodeChefOpen on judge ↗
Bob is having a deck of $N$ playing cards. In this deck each of the cards is asssociated with a power level. Bob is shuffeling the deck. In each of the shuffle he takes out any continous segment of cards from the deck and keeps it at the top of the deck. Every time he shuffles, he chooses a random number and wonders what is the maximum length of continous subsegment he can take out from the deck s
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