Naruto and Bridges (Easy-medium)
CodeChefOpen on judge ↗
Byteland and Codetown are connected by two parallel bridges. Each bridge is made of a single line of blocks and both bridges have N of blocks. Now Naruto wants to go from Byteland to Codetown. He knows that stepping on each block costs the traveller some amount of chakra (type of energy). He can start at any bridge and finish at any bridge. To move forward he can jump upto K blocks ahead in 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