Zikara and Roads
CodeChefOpen on judge ↗
There are n +1 (numbered from 0 to n) cities in the world where you live, the sheriff of Pune wants to ask Zikara some queries of following 2 types: - Add a road between city A and city B (represented by 1 A B). - Tell the sheriff that whether there is a way to reach city A from B (represented by 2 A B). ### Input The first line contains an integer n– the number of cities The second line contai
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