Need help with implementation of MST Queries

Problem : MSTQS Problem - CodeChef (based on minimal spanning tree and Kruskals)
Editorial : MSTQS - Editorial
My solution : CodeChef: Practical coding for everyone
I understand everything that has been said in the editorial. But the links to author and tester solutions are unavailable. My code is passing all TCs of subtask 2; but not some of 1 and 3. I have tested as thoroughly as I could. Would appreciate if someone can point out bug(s). zwe stand for zer-weighted edges in code.

1 Like