HDU 6187 Destroy Walls (思维,最大生成树) Destroy Walls *Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others) Total Submission(s): 1784 Accepted Submission(s): 692 * Problem Description Long times ago, there are beautiful histor…
Destroy Walls Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others) Total Submission(s): 1774 Accepted Submission(s): 689 Problem Description Long times ago, there are beautiful historic walls in the city. These wal…
http://acm.hdu.edu.cn/showproblem.php? pid=4786 Fibonacci Tree Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1733 Accepted Submission(s): 543 Problem Description Coach Pang is interested i…
Pseudoforest Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1705 Accepted Submission(s): 653 Problem Description In graph theory, a pseudoforest is an undirected graph in which every conne…
Destroy Walls Long times ago, there are beautiful historic walls in the city. These walls divide the city into many parts of area. Since it was not convenient, the new king wants to destroy some of these walls, so he can arrive anywhere from his cast…
Pseudoforest Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2351 Accepted Submission(s): 910 Problem Description In graph theory, a pseudoforest is an undirected graph in which every connec…
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> using namespace std; ; int n, m; struct node { int u, v, c; }g[maxn]; long long ans; int fa[maxn]; int ff[maxn]; int ee[maxn]; bool cmp(node a, node b){ re…