n个点m条无向边的图,对于q个询问,每次查询点对间最小瓶颈路 >=f 的点对有多少. 最小瓶颈路显然在kruskal求得的MST上.而输入保证所有边权唯一,也就是说f[i][j]肯定唯一了. 拿到这题第一反映是用次小生成树的prim算法在求MST的同时求出每对点对的瓶颈路.几乎就是一个模板题,无奈却MLE... 于是换算法,用kruskal求MST,然后对于MST,离线LCA求出所有点对的瓶颈路.同UVA 11354 Bond(MST + LCA)然后剩下的就是读入&二分查找输出了..无奈还…
Divide Groups Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 423    Accepted Submission(s): 161 Problem Description   This year is the 60th anniversary of NJUST, and to make the celebration mor…
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…
Walk Through Squares Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 200    Accepted Submission(s): 57 Problem Description   On the beaming day of 60th anniversary of NJUST, as a military colleg…
Poker Shuffle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 95    Accepted Submission(s): 24 Problem Description Jason is not only an ACMer, but also a poker nerd. He is able to do a perfect s…
Theme Section Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 271    Accepted Submission(s): 121 Problem Description It's time for music! A lot of popular musicians are invited to join us in the…
Two Rabbits Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 505    Accepted Submission(s): 260 Problem Description Long long ago, there lived two rabbits Tom and Jerry in the forest. On a sunny…
F(x) Time Limit: 1000/500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 382    Accepted Submission(s): 137 Problem Description For a decimal number x with n digits (AnAn-1An-2 ... A2A1), we define its weight as F(x…
Minimum palindrome Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 260    Accepted Submission(s): 127 Problem Description Setting password is very important, especially when you have so many "in…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4750 题意:给出一个无向图,f(a,b)表示从点a到点b的所有路径中的每条路径的最长边中的最小值,给出 p个询问,每个询问有一个数t,对于每个询问,求有多少对顶点f(a,b)小于t.注意(1,2)和(2,1)是不同的点对 分析: 正过来想不太好做..反过来..看在当前t的限制下..有多少个点对f(u,v)<t...这样答案就是totol-sum...totol是总对数n*(n-1)...sum是当前…