
LCA
文章平均质量分 75
Mr_Treeeee
这个作者很懒,什么都没留下…
展开
-
POJ 3694 Network(tarjan+lca)
NetworkTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 10463 Accepted: 3899DescriptionA network administrator manages a large network. The network consists of N computers and M links between...原创 2017-09-20 12:40:09 · 381 阅读 · 0 评论 -
EOJ Monthly 2018.8 - D. Delivery Service(树上差分)
https://acm.ecnu.edu.cn/contest/103/problem/D/ 题意: 给你一棵树,n-1条边和权值,给你q个起点和终点。 你可以在【最初】无限次交换边的权值,问你最小花费是多少。 POINT: 这个问题其实就是求每条边被走过了几次。然后按照从多到少分别给从小到大的权值即可。 前面一个问题就是树上差分问题。 #include <stdio....原创 2018-08-12 11:52:50 · 416 阅读 · 0 评论 -
Codeforces Beta Round #33 - D. Knights (暴力//建图+lca//bitset状态压缩)
D. Knightstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBerland is facing dark times again. The army of evil lord Van de Mart is going to conque...原创 2018-03-25 18:45:47 · 506 阅读 · 0 评论 -
POJ 3728 - The merchant (LCA)
The merchantTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 5658 Accepted: 1949DescriptionThere are N cities in a country, and there is one and only one simple path between each pair of citi...原创 2018-03-25 10:53:55 · 238 阅读 · 0 评论 -
POJ 3417 - Network (LCA+DP)
NetworkTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 5627 Accepted: 1595DescriptionYixght is a manager of the company called SzqNetwork(SN). Now she's very worried because she has just rec...原创 2018-03-25 10:50:14 · 209 阅读 · 0 评论 -
HDU 3830 - Checkers (LCA模型)
CheckersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 125536/65536 K (Java/Others)Total Submission(s): 1774 Accepted Submission(s): 515Problem DescriptionLittle X, Little Y and Little Z a...原创 2018-03-25 10:47:19 · 469 阅读 · 0 评论 -
HDU 4409 - Family Name List (LCA)
Family Name ListTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1345 Accepted Submission(s): 443Problem DescriptionKong belongs to a huge fam...原创 2018-03-19 22:17:34 · 307 阅读 · 0 评论 -
HDU 3078 - Network (LCA)【tarjan离线/DFS倍增】
NetworkTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1628 Accepted Submission(s): 726Problem DescriptionThe ALPC company is now working on ...原创 2018-03-19 22:11:27 · 273 阅读 · 0 评论 -
HDU 4547 - CD操作 (LCA)
CD操作Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2726 Accepted Submission(s): 752Problem Description 在Windows下我们可以通过cmd运行DOS的部分功能,其中CD是一...原创 2018-03-19 22:06:12 · 324 阅读 · 0 评论 -
Educational Codeforces Round 51 (Rated for Div. 2) - F. The Shortest Statement (树上距离查询+最短路)
http://codeforces.com/contest/1051/problem/F 题意: 给你n个点,m条边。m-n<=20。保证图连通。 问你任意两点的最短距离是多少。 POINT: 由图连通可知,这个图是 在生成树的基础上加了m-(n-1)条边。然后问你距离。 在HDU多校做过一道类似的。是不过只增加了一条边。即m=n。那么我们只要考虑两种情况: 1.在树上的...原创 2018-09-23 10:43:59 · 285 阅读 · 0 评论