hdu4612 Warm up 缩点+树的直径
摘要:题意抽象后为:给定一个无向图 问添加一条边的情况下最少能有多少个桥。 桥的定义:删除该边后原图变为多个连通块。 数据规模:点数N(2<=N<=200000),边数M(1<=M<=1000000) 缩点之后求一下树的直径就好了,最优加边方案显然为连接直径的头尾。 AC代码:
阅读全文
posted @ 2017-11-12 19:06
posted @ 2017-11-12 19:06
posted @ 2017-11-12 18:57
posted @ 2017-11-12 18:47
posted @ 2017-11-12 18:37