Coal Mafia and Toll Tax
CodeChefOpen on judge ↗
You are one of the notorious coal mafias. You run an illegal coal mining business. There are $n$ villages, enumerated from $1$ to $n$ from left to right. Each village has some coal mines. This information is given to you by an integer $coal_i$ denoting the amount of coal (in kgs) in village $i$. The cost of coal is fixed at 1 rupee per kg. There are toll booths in the highway at the middle of the
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