← All problemsSign in

One-Way Roads

A city has a road network with all roads arranged in a **K** x **K** square grid, with intersections (total (**K**+1) x (**K**+1)) numbered as shown below (for an example 4 x 4 grid). ![Grid](//www.codechef.com/download/grid_kgp.png) There are no one-way roads in the city now. For ease of movement of cars, the traffic department plans to convert all roads to one-way, while ensuring that any inte

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start