Countries And Friends
CodeChefOpen on judge ↗
Alan wants to flee from the country. He has $N$ friends going out of the country to different places. Each friend is willing to go to any country as long as it’s in their favourite list. Each friend has $K$ countries in their favourite list. You are given $Q$ queries. In each query, you’ll be given a distance and Alan wants to get away from the country by more than or equal to that dista
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