Comments
On touristCodeforces Round #850, 4 years ago
+15

$$$\color{black}{j}\color{red}{iangly}$$$ 's code is enlightening.

On touristCodeforces Round #850, 4 years ago
+9

1B can be done by brute force.Here's my ugly code code

On touristCodeforces Round #850, 4 years ago
0

Me too!!Got stuck and got 9 WAs :(

When $$$y_{i-1}$$$ and $$$x_{i+1}$$$ are fixed, we can see that if $$$y_{i-1}$$$ is smaller than $$$x_{i+1}$$$,$$$x_i$$$ should be maximum to lower the answer,vice versa.So we can determine $$$x_i$$$ and $$$y_i$$$ (one of them must be maximum)

!Thank you very much for your splendid answer!!!

For F,I can't quite understand why we should choose an unvisited vertex u "with the largest degree" ? Can someone help me?