GAME OF CARDS
CodeChefOpen on judge ↗
Chef wants to play a game of cards. The rules of the game are as follows. There are $N$ cards in front of Chef. Each card $K_i$ is marked with a non-zero positive integer. There is a number $M$ given to Chef. To win the game Chef has to pick the cards whose numbers accumulate to $M$ or greater than $M$. Assuming Chef knows all the numbers of the cards, find the least number of picks required by
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