← All problemsSign in

Training Plans

CodeChefRating 2065Open on judge ↗

Nathan is preparing for the Dash marathon. He has $N$ training plans. The $i$-th plan has an effectiveness of $A_i$, but requires that at least $B_i$ other training plans must be performed before it. A training plan cannot be repeated. If he performs some $K \gt 0$ distinct trainings - $P_1, P_2, \ldots , P_K$ $(1 \le P_i \le N, P_i \neq P_j)$ then his training score is $\frac{\sum_{j=1}^{K} A_{

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