Help Rishi and Amit
CodeChefOpen on judge ↗
Rishi and Amit want to visit the chefland but chef will allow them only if they will help him to solve the following problem. Chefland is like a 2-D grid where each cell is labelled with '0' or '1'. Cells with 1's represent shops and cells with 0's represent customers. Now every customer will have to go to at least one shop to purchase goods. When customer reaches to some shop it costs him/her so
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