
树的直径、重心、分治
文章平均质量分 80
笑着走完自己的路
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
poj 1985 Cow Marathon 【树的直径】
Cow MarathonTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 4088 Accepted: 2068Case Time Limit: 1000MSDescriptionAfter hearing about the epidemic原创 2015-07-12 21:00:54 · 536 阅读 · 0 评论 -
Codeforces 592D Super M 【求解包含若干个点的最小树 + 树的直径】
D. Super Mtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAri the monster is not an ordinary monster. She原创 2015-11-08 12:40:09 · 833 阅读 · 0 评论 -
poj 1655 Balancing Act 【树形DP 求树的重心】
Balancing ActTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10726 Accepted: 4463DescriptionConsider a tree T with N (1 <= N <= 20,000) nodes numbered 1原创 2015-08-03 10:03:15 · 726 阅读 · 0 评论 -
hdoj 4612 Warm up 【无向图边双连通求桥数 缩点后求树的直径 桥数-树的直径】
Warm upTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 4569 Accepted Submission(s): 1031Problem Description N planets are con原创 2015-07-16 12:58:51 · 659 阅读 · 0 评论 -
hdoj 2196 Computer 【树的直径 求每个点的最长路】
ComputerTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4365 Accepted Submission(s): 2194Problem DescriptionA school bought原创 2015-08-05 21:10:40 · 701 阅读 · 0 评论 -
树的直径 【总结】
树的直径问题:有N个点以及M条路径,给出M条路的长度,让你找到一条 两点(任意的)间的路径,使得距离最长,并输出最长距离。思路:第一次BFS找最长路径的一个端点,第二次BFS求最长距离。模板:#include #include #include #include #define MAXN 40000+10#defin原创 2015-07-19 09:01:59 · 842 阅读 · 2 评论 -
hdoj 4123 Bob’s Race 【树的直径 + RMQ】 【二分查询会超时】
Bob’s RaceTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2776 Accepted Submission(s): 896Problem DescriptionBob wants to hol原创 2015-08-06 00:14:05 · 574 阅读 · 0 评论 -
Lightoj 1094 - Farthest Nodes in a Tree 【树的直径 裸题】
1094 - Farthest Nodes in a TreePDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBGiven a tree (a connected graph with no cycles), yo原创 2015-08-17 16:44:23 · 976 阅读 · 0 评论 -
hdoj 4607 Park Visit 【树的直径的应用 求一棵树中经过k个点需要走的最短距离】
Park VisitTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2754 Accepted Submission(s): 1249Problem DescriptionClaire and her原创 2015-08-05 10:13:40 · 983 阅读 · 0 评论 -
hdoj 4514 湫湫系列故事——设计风景线 【并查集 + 非连通图 求多棵树的最大直径】
湫湫系列故事——设计风景线Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 3482 Accepted Submission(s): 610Problem Description 随着杭州西湖的知名度的原创 2015-08-03 21:05:49 · 777 阅读 · 0 评论 -
poj 1383 Labyrinth 【迷宫图 BFS实现 树的直径裸题】
LabyrinthTime Limit: 2000MS Memory Limit: 32768KTotal Submissions: 3990 Accepted: 1501DescriptionThe northern part of the Pyramid contains a very large and compli原创 2015-08-03 17:52:36 · 1181 阅读 · 0 评论 -
poj 2631 Roads in the North 【树的直径裸题】
Roads in the NorthTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2350 Accepted: 1152DescriptionBuilding and maintaining roads among communities in the原创 2015-08-03 12:09:23 · 507 阅读 · 0 评论 -
Codeforces 14D Two Paths 【树的直径】
题目链接:Codeforces 14D Two Paths原创 2016-03-12 19:03:56 · 552 阅读 · 0 评论