← All problemsSign in

Trade Nations

There are $N$ nations in ByteLand. Every nation wants to do trade with the other nations. In order to enable this trade, the nations start signing trade treaties. The $i_{th}$ trade treaty is an agreement between two nations $x_i$ and $y_i$ for trading goods at a fixed price $c_i$. Countries which have trade treaties signed between them can also deliver goods to each other (which they might've bou

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