树形DP
Another Crisis
Time Limit: 3000MS
Memory Limit: Unknown
64bit IO Format: %lld & %llu
Submit Status
Description
A couple of years ago, a new worl...
分类:
其他好文 时间:
2015-02-15 16:37:08
阅读次数:
155
http://acm.hdu.edu.cn/showproblem.php?pid=3534
Problem Description
In the Data structure class of HEU, the teacher asks one problem: How to find the longest path of one tree and the number...
分类:
其他好文 时间:
2015-02-14 18:56:57
阅读次数:
190
Anniversary party
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 4567
Accepted: 2594
Description
There is going to be a party to celebrate the 80-th Anniv...
分类:
其他好文 时间:
2015-02-14 17:34:09
阅读次数:
153
算法训练 结点选择
时间限制:1.0s 内存限制:256.0MB
问题描述
有一棵 n 个节点的树,树上每个节点都有一个正整数权值。如果一个点被选择了,那么在树上和它相邻的点都不能被选择。求选出的点的权值和最大是多少?
输入格式
第一行包含一个整数 n 。
接下来的一行包含 n 个正整数,第 i 个正整数代表点 i 的权值。
...
分类:
编程语言 时间:
2015-02-14 13:49:31
阅读次数:
531
http://poj.org/problem?id=1655
Description
Consider a tree T with N (1 <= N <= 20,000) nodes numbered 1...N. Deleting any node from the tree yields a forest: a collection of one or more trees. D...
分类:
其他好文 时间:
2015-02-14 08:43:14
阅读次数:
216
题目链接:点击打开链接
题意:
给定n个城市和m条可选择修建的道路
下面n行给出每个城市的名字
下面m行给出每条道路及修建该道路的花费。
下面4行,每行给出一对城市。
目标:使得最后4行的每对城市连通(不同对之间可以不连通)所需要修建的最小花费。
数据保证存在可行解
思路:
首先如果这个问题问的是所有城市都连通,就是一个最小生成树的问题。
这里就相当于多个最小生成树的 问题。...
分类:
其他好文 时间:
2015-02-12 16:11:52
阅读次数:
245
http://acm.hdu.edu.cn/showproblem.php?pid=3586
Problem Description
In the battlefield , an effective way to defeat enemies is to break their communication system.
The information department t...
分类:
其他好文 时间:
2015-02-11 22:01:33
阅读次数:
212
http://acm.hdu.edu.cn/showproblem.php?pid=4044
Problem Description
Tower defense is a kind of real-time strategy computer games. The goal of tower defense games is to try to stop enemies f...
分类:
其他好文 时间:
2015-02-11 14:39:31
阅读次数:
155
题目链接:点击打开链接
题意:给定n个点的树,常数d
给出每个点的权值,问有多少种划分方法使得划分后每个连通块里的最大权值-最小权值
思路:点击打开链接
枚举每个点i 使得i是集合中的最小值。
则枚举时已经使得i是最小值,然后这个问题就变成单纯的划分问题了,上面链接里的题解已经很详尽了
import java.io.PrintWriter;
import java.text.Decim...
分类:
其他好文 时间:
2015-02-07 21:44:19
阅读次数:
240
http://acm.hdu.edu.cn/showproblem.php?pid=1011
Problem Description
You, the leader of Starship Troopers, are sent to destroy a base of the bugs. The base is built underground. It is actually a...
分类:
其他好文 时间:
2015-02-06 20:34:53
阅读次数:
135