Weird World Cup
CodeChefOpen on judge ↗
N teams are playing in this cricket world cup, numbered from 1 .. N. Each team plays every other team exactly once in the World Cup. No match ever results in a draw. Team x is said to directly win over team y if in the match between x and y, x wins. Team x is said to indirectly win over y if there exists a sequence of teams a1, a2, ...., ak where a1 = x, ak = y, k >= 2 and for each 1 ≤ i ≤ k - 1,
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