Loading

随笔分类 -  ACM——图论

摘要:http://codeforces.com/gym/100781/attachments 题意:有N个点,M条边,问对两两之间的树添加一条边之后,让整棵大树最远的点对之间的距离最近,问这个最近距离是多少。 思路:一开始看成只有两个连通块,后来才注意到是多个连通块。DFS搜树上最长路径。答案有三种:第 阅读全文
posted @ 2016-09-23 18:09 Shadowdsp 阅读(778) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5876 Sparse Graph Problem Description In graph theory, the complement of a graph G is a graph H on the same 阅读全文
posted @ 2016-09-12 09:33 Shadowdsp 阅读(549) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=2679 Adventurous Driving Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1596 Accepted: 455 Description After a p 阅读全文
posted @ 2016-08-04 22:51 Shadowdsp 阅读(351) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5521 Meeting Problem Description Bessie and her friend Elsie decide to have a meeting. However, after Farmer 阅读全文
posted @ 2016-07-29 09:56 Shadowdsp 阅读(500) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5723 Abandoned country Problem Description An abandoned country has n(n≤100000) villages which are numbered 阅读全文
posted @ 2016-07-20 15:30 Shadowdsp 阅读(402) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=3321 http://acm.hdu.edu.cn/showproblem.php?pid=3887 POJ 3321: 题意:给出一棵根节点为1的边不一定的树,然后给出问题:询问区间和 或者 节点值更新。 HDU 3887: 题意:和POJ 3 阅读全文
posted @ 2016-07-18 20:28 Shadowdsp 阅读(237) 评论(0) 推荐(0)
摘要:http://codeforces.com/contest/691/problem/D D. Swaps in Permutation D. Swaps in Permutation You are given a permutation of the numbers 1, 2, ..., n an 阅读全文
posted @ 2016-07-14 09:56 Shadowdsp 阅读(500) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1533 Going Home Problem Description On a grid map there are n little men and n houses. In each unit time, ev 阅读全文
posted @ 2016-07-12 15:37 Shadowdsp 阅读(1148) 评论(0) 推荐(0)