Money Lenders problem
CodeChefOpen on judge ↗
A Money lender lends money to a group of villagers living in M houses in Pearl Harbor that are numbered sequentially from 1 to M. There are N roads, and each road i connects two different houses, Xi and Yi. Each villager house j (where 1 ≤ j ≤ M) has Cj rupees stashed away for a rainy day. As long as a villager is home at house j, money lender knows they will hand over all of their saved money, C
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