Optimal Traveller
CodeChefOpen on judge ↗
There is a contest named OPTIMAL TRAVELLER. In this contest, there is a town comprised of n checkpoints and m roads. While travelling through the roads of town, one can earn coins. The coins earned while travelling through the $i$$^t$$^h$ road is $w_i$. But when a traveller reaches a certain checkpoint, he has to spend certain coins. The coins spent while reaching the $i$$^t$$^h$ checkpoint
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