题目链接:http://poj.org/problem?id=1251
简单题
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define INF 10000000
int n, m;
char a[5], b[5];
int c, d;
int ma...
分类:
其他好文 时间:
2015-01-25 15:19:58
阅读次数:
165
http://acm.hdu.edu.cn/showproblem.php?pid=4313
Problem Description
Machines have once again attacked the kingdom of Xions. The kingdom of Xions has N cities and N-1 bidirectional roads. The ro...
分类:
其他好文 时间:
2015-01-25 12:34:35
阅读次数:
145
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1102题意:这道题实际上和hdu 1242 Rescue 非常相似,改变了输入方式之后, 本题实际上更适合用Prim来做。 用Kruscal的话要做一些变化。/*Constructing RoadsTim...
分类:
其他好文 时间:
2015-01-24 22:41:12
阅读次数:
166
题目链接:HDU 1102 Constructing RoadsConstructing RoadsProblem DescriptionThere are N villages, which are numbered from 1 to N, and you should build some r...
分类:
其他好文 时间:
2015-01-23 22:43:08
阅读次数:
245
Constructing Roads In JGShining's Kingdom
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 16956 Accepted Submission(s): 4819
Proble...
分类:
其他好文 时间:
2015-01-23 09:36:18
阅读次数:
162
Constructing RoadsTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 19884Accepted: 8315DescriptionThere are N villages, which are numbered from...
分类:
编程语言 时间:
2015-01-22 10:46:19
阅读次数:
314
题目大意:热带的一个岛上有N个村庄,还有一些路,现在丛林把道路给破坏了。酋长
想要去掉一些不必要的路,使得剩下的路既能联通全部村庄,又能使总路程最短。求:
这个最短的总路程是多少
思路:就是给你N个点,M条边,求最小生成树。用Prim算法来做,输入的时候将字母
代表的村庄转换为下标(即字母 - 'A')即可。...
分类:
其他好文 时间:
2015-01-19 22:41:24
阅读次数:
215
题目大意:根据两个点建立一条有向边,最后可形成的是一棵树,希望通过切除一些边,使一棵含有p个节点的子树被独立出来,希望切除的边数最少,输出这个边数这个是第一次自己完完整整做出来的树形Dp题目,没有参考别人的DP思路,虽然自己很快想好了,但是总是无法合适的进行组织,做了很久,但自己做出来的总是会比取理...
分类:
其他好文 时间:
2015-01-18 22:31:20
阅读次数:
224
我要翻译题目!!!/*A group of cows grabbed a truck and ventured on anexpeditiondeep into the jungle. Being rather poor drivers, the cows unfortunately managed...
分类:
编程语言 时间:
2015-01-18 19:41:57
阅读次数:
394
Pat1087代码
题目描述:
Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness.
Input S...
分类:
其他好文 时间:
2015-01-10 01:31:07
阅读次数:
245