This problem need to calculate the Eulerian Path.
I used vector to store the graph as usual, but I got TLE on 21. 322076342
After I changed to chain forward star, It passed. 322077896
Does anybody know the reason? I think both methods are $$$O(n\log n)$$$.