随笔分类 -  图论

摘要:原题链接:http://poj.org/problem?id=2488我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=19651#problem/AA Knight's JourneyTime Limit:1000MSMemory Limit:65536KTotal Submissions:23452Accepted:7944DescriptionBackgroundThe knight is getting bored of seeing the same black and white squares again 阅读全文
posted @ 2013-03-02 21:32 free斩 阅读(385) 评论(0) 推荐(0)
摘要:DFS 水题原题链接:http://poj.org/problem?id=3620我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=19651#problem/BAvoid The LakesTime Limit:1000MSMemory Limit:65536KTotal Submissions:5563Accepted:2995DescriptionFarmer John's farm was flooded in the most recent storm, a fact only aggravated by t 阅读全文
posted @ 2013-03-02 19:08 free斩 阅读(504) 评论(0) 推荐(0)
摘要:最短路的简单应用问题。原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=3790CSUST链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=19760#problem/L最短路径问题Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6346Accepted Submission(s): 1922Problem Description给你n个 阅读全文
posted @ 2013-03-01 19:16 free斩 阅读(254) 评论(0) 推荐(0)
摘要:原题链接:http://poj.org/problem?id=1062我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=19651#problem/E昂贵的聘礼Time Limit:1000MSMemory Limit:10000KTotal Submissions:29628Accepted:8296Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯, 阅读全文
posted @ 2013-03-01 17:56 free斩 阅读(191) 评论(0) 推荐(0)
摘要:原题链接:http://poj.org/problem?id=1847我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=19651#problem/D最短路模板题。TramTime Limit:1000MSMemory Limit:30000KTotal Submissions:7960Accepted:2861DescriptionTram network in Zagreb consists of a number of intersections and rails connecting some of them. In 阅读全文
posted @ 2013-02-27 20:17 free斩 阅读(355) 评论(0) 推荐(0)
摘要:题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1076我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=19651#problem/H1076. TrashTime Limit: 1.0 secondMemory Limit: 16 MBDescriptionYou were just hired as CEO of the local junkyard.One of your jobs is dealing with the incoming trash and 阅读全文
posted @ 2013-02-26 20:24 free斩 阅读(340) 评论(0) 推荐(0)
摘要:原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=3488我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=17728#overviewTourTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 1147Accepted Submission(s): 604Problem DescriptionIn the kingdom of Henr 阅读全文
posted @ 2013-02-26 16:23 free斩 阅读(203) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1853我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=17728#problem/CKM算法模板:http://blog.csdn.net/cfreezhan/article/details/8246639用KM求最小费用模板题:http://blog.csdn.net/cfreezhan/article/details/8256926Cyclic TourTime Limit: 1000/1000 MS (Java/Others 阅读全文
posted @ 2013-02-26 15:55 free斩 阅读(190) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2813我的链接:http://acm.hust.edu.cn:8080/judge/contest/view.action?cid=17728#problem/L算法思想:二分图的最优匹配求最小权覆盖,吕布的战将为集合一(二分图的行),曹操的战将为集合二(二分图的列),如果两边的战将间有战争就连边,建图。 然后直接套模板即可。 题目的关键是如何输入且存储两边的战将名字,这里用到了C++中STL的map容器,水过了。PS:大牛说字典树最快。 STL的map: 头文件#include<map> 阅读全文
posted @ 2012-12-05 13:00 free斩 阅读(236) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1533我的链接:http://acm.hust.edu.cn:8080/judge/contest/view.action?cid=17728#problem/BGoing HomeTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1895Accepted Submission(s): 918Problem DescriptionOn a grid 阅读全文
posted @ 2012-12-04 18:04 free斩 阅读(162) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1533我的链接:http://acm.hust.edu.cn:8080/judge/contest/view.action?cid=17728#problem/BGoing HomeTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1895Accepted Submission(s): 918Problem DescriptionOn a grid 阅读全文
posted @ 2012-12-04 18:04 free斩 阅读(153) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2255奔小康赚大钱Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1422Accepted Submission(s): 626Problem Description传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有 阅读全文
posted @ 2012-12-01 15:58 free斩 阅读(132) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2255奔小康赚大钱Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1422Accepted Submission(s): 626Problem Description传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有 阅读全文
posted @ 2012-12-01 07:58 free斩 阅读(150) 评论(0) 推荐(0)