← All problemsSign in

Traffic Jam

You are given n cities which are connected by m roads. The cities intially has no houses. You have to build either 5 or 6 or 7 houses in each city. There will never be a traffic jam on road connecting two adjacent city (two city are adjacent if it is directly connected with single road) if sum of number of houses in the cities on both ends of road is odd. Calculate the number of possib

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