How far away ? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 14685 Accepted Submission(s): 5554 Problem Description There are n houses in the village and some bidirectional roads connecting…
链接: How far away ? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11204 Accepted Submission(s): 4079 Problem Description There are n houses in the village and some bidirectional roads connec…
HDU - 2586 How far away ? Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u Submit Status Description There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like th…
How far away ? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9359 Accepted Submission(s): 3285 Problem Description There are n houses in the village and some bidirectional roads connecting…
How far away ? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 25408 Accepted Submission(s): 10111 Problem Description There are n houses in the village and some bidirectional roads connectin…
HDU 2586 How far away ? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11320 Accepted Submission(s): 4119 Problem Description There are n houses in the village and some bidirectional roads…
2018.9.10 0:40 重新敲一遍,然后很认真的写了注释,方便自己和队友看,刚过去的一天的下午打网络赛有一题用到了这个,但是没写注释,队友改板子有点伤,因为我没注释... 以后写博客,代码要写注释,要把题目意思写上... 我好捞啊... How far away ? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 21408 …
先给个LCA模板 HDU 1330(LCA模板) #include <cstdio> #include <cstring> #define N 40005 struct Edge{ int x,y,d,ne; }; Edge e[N*],e2[N*]; int be[N],be2[N],all,all2,n,m; bool vis[N]; int fa[N]; ]; int dis[N]; void add(int x, int y, int d, Edge e[], int be…
Dylans loves tree Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1444 Accepted Submission(s): 329 Problem Description Dylans is given a tree with N nodes. All nodes have a value A[i].Nodes…
题目: Description A rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, each node is labeled with an integer from {1, 2,...,16}. Node 8 is the root of the tree. Node x is an ancesto…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2586 Problem Description There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is it if I want to go from house A to house…
How far away ? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 20971 Accepted Submission(s): 8245 Problem Description There are n houses in the village and some bidirectional roads connecting…
How far away ? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8712 Accepted Submission(s): 3047 Problem Description There are n houses in the village and some bidirectional roads connecting…