摘要:
Description In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping 阅读全文
posted @ 2019-03-08 17:34
plysc
阅读(104)
评论(0)
推荐(0)
摘要:
这两个题差不多先说异象石把 主要是找到本题规律,将所加入的点按dfs序排序,记录为a[1],a[2]..a[n]则当前的答案为每个点与前一个点的距离(第一个点则与最后一点) 当然要动态维护答案,每加入一个点就+与前驱的距离+与后驱的距离-前驱与后驱的距离(删点的话ans减去这个值就好 不过异象石最后 阅读全文
posted @ 2019-03-08 16:12
plysc
阅读(266)
评论(0)
推荐(0)

浙公网安备 33010602011771号