omkar and graphs
CodeChefOpen on judge ↗
. ### Input - The input is given from Standard Input in the following format: N M p1 q1 w1 p2 q2 w2 ... pM qM wM Q A1 B1 A2 B2 .. AQ BQ ### Output Print Q lines. The i-th line should contain the minimum possible total weight of the edges chosen by Omkar. ### Constraints 1≦N≦4,000 1≦M≦400,000 1≦Q≦100,000 1≦pi,qi,Ai,Bi≦N 1≦wi≦10^9 pi != qi Ai != Bi - The given graph is connecte
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