← All problemsSign in

Killing Gs

CodeChefRating 3326Open on judge ↗

There are the big enemies for all chefs, that is, Gs (the plural form of G). Chef Ciel find N Gs in her restaurant. Ciel is very scared, and she is going to kill the Gs by using insecticides. Here M insecticides are available, and the price of the j-th insecticide is Cj, and she can use the j-th insecticide for all N Gs if she buys it. Unfortunately Gs may have resistance to insecticides, so Gs ma

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