Count The Pairs Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 277 Accepted Submission(s): 150 Problem Description With the 60th anniversary celebration of Nanjing University of Science…
Problem Description With the 60th anniversary celebration of Nanjing University of Science and Technology coming soon, the university sets n tourist spots to welcome guests. Of course, Redwood forests in our university and its Orychophragmus violaceu…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4750 题意:Q个询问t,求在一个无向图上有多少对点(i,j)满足 i 到 j 的所有路径上的最长边的最小值大于等于t. (i,j)所有路径上的最长边的最小值,容易想到就是 i, j之间的瓶颈路,瓶颈路也就是最小生成树上的边了.注意到每条边的权值都是不相等的,那么MST就是确定的.假设当前MST的边的权值是f[i],Kruskal的并查集中维护一个cnt[i],表示以节点 i 为根的集合的节点个数,那…