随笔分类 - ACM——图论
摘要:http://codeforces.com/gym/100781/attachments 题意:有N个点,M条边,问对两两之间的树添加一条边之后,让整棵大树最远的点对之间的距离最近,问这个最近距离是多少。 思路:一开始看成只有两个连通块,后来才注意到是多个连通块。DFS搜树上最长路径。答案有三种:第
阅读全文
摘要: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
阅读全文
摘要:http://poj.org/problem?id=2679 Adventurous Driving Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1596 Accepted: 455 Description After a p
阅读全文
摘要: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
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5723 Abandoned country Problem Description An abandoned country has n(n≤100000) villages which are numbered
阅读全文
摘要:http://poj.org/problem?id=3321 http://acm.hdu.edu.cn/showproblem.php?pid=3887 POJ 3321: 题意:给出一棵根节点为1的边不一定的树,然后给出问题:询问区间和 或者 节点值更新。 HDU 3887: 题意:和POJ 3
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文

浙公网安备 33010602011771号