题意略. 思路:我的想法是逐步地找出这个序列中的重要点,我要判断当前这个点能不能删去,就要看上一个重要点和当前这个点 i 在序列中的下一个点 i + 1之间的距离 是否是最短距离,如果是,那么我们就可以化简掉当前这个点(当然,上一个重要点不能和下一个点 i + 1是同一个点). 还有一种做法是判断三个连续的点,如果第一个点和第三个点之间没有直接的边相连,那么第二个点一定会通过,也就是说会被化简掉. 代码如下: #include<bits/stdc++.h> using namespace st…