• + 1 comment

    How could the editorial solve the problem with cities={2, 3} and roads={{1, 2, 1}, {1, 3, 3}, {2, 4, 2}, {3, 4, 4}}? It's a 4-node graph connected in a circle. The editorial would return 20-9=11 instead of the expected result of 4?