2017年4月23日

摘要: 题目来源:http://poj.org/problem?id=1042 题目大意:一个人在一个打算在编号1~n的湖里钓鱼,钓鱼是单向走的,不能往回走。给你n个湖,每个湖初始鱼的数量pi每次每个湖钓鱼后鱼的减少量di,第i个湖到第i+1湖的距离时间ti(单位是5min。。。),这个人可以在任何湖停止钓 阅读全文
posted @ 2017-04-23 23:35 jokermarvelous 阅读(155) 评论(0) 推荐(0) 编辑
 
摘要: 题目地址:http://poj.org/problem?id=2421 题意:给你n个点,然后求最小生成树。特殊之处在于有一些点之间已经连上了边。 思路:使用kruscal算法,对于已经有边的点,特殊标记一下,加边的时候把这些边的权值赋值为0即可。这样就可以既保证这些边一定存在,又保证了所求的结果正 阅读全文
posted @ 2017-04-23 17:21 jokermarvelous 阅读(127) 评论(0) 推荐(0) 编辑
 
摘要: Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,00 阅读全文
posted @ 2017-04-23 16:34 jokermarvelous 阅读(161) 评论(0) 推荐(0) 编辑
 
摘要: Background The knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey around the world. 阅读全文
posted @ 2017-04-23 16:17 jokermarvelous 阅读(177) 评论(0) 推荐(0) 编辑
 
摘要: 题意:此题题意远比题目难 首先,题目可能有多组测试数据,每个测试数据的第一行为经纪人数量N(当N=0时,输入数据结束),然后接下来N行描述第i(1<=i<=N)个经纪人与其他经纪人的关系(教你如何画图)。每行开头数字M为该行对应的经纪人有多少个经纪人朋友(该节点的出度,可以为0),然后紧接着M对整数 阅读全文
posted @ 2017-04-23 15:22 jokermarvelous 阅读(132) 评论(0) 推荐(0) 编辑
 
摘要: Description Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,00 阅读全文
posted @ 2017-04-23 15:01 jokermarvelous 阅读(156) 评论(0) 推荐(0) 编辑
 
摘要: Description Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating 阅读全文
posted @ 2017-04-23 14:12 jokermarvelous 阅读(186) 评论(0) 推荐(0) 编辑
 
摘要: Charm Bracelet Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 38561 Accepted: 16727 Description Bessie has gone to the mall's jewelry stor 阅读全文
posted @ 2017-04-23 12:14 jokermarvelous 阅读(106) 评论(0) 推荐(0) 编辑
 
摘要: 题意:求一段整数序列任意两端不相交的串的和的最大值。 题目思路:用dp动态规划,先开辟一个标志数组从左到右分别记录每一段序列和的最大值,再从右到左分别根据已经记录好的标志数组计算最大和的值。 阅读全文
posted @ 2017-04-23 11:07 jokermarvelous 阅读(101) 评论(0) 推荐(0) 编辑