← All problemsSign in

Special Missions

CodeChefRating 1026Open on judge ↗

You are playing a game with $N$ missions to complete. The $i$-th mission pays $A_i$ coins. You can choose whether to complete each mission or not, and also the order in which you want to complete them. However, some of the missions are special ones, and to access them you need to pay a one-time fee to a wizard, of $C$ coins. (You only need to pay once, not per every special mission you wish to co

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