码迷,mamicode.com
首页 >  
搜索关键字:travelling    ( 130个结果
zoj 2027 Travelling Fee
Description Samball is going to travel in the coming vacation. Now it's time to make a plan. After choosing the destination city, the next step is to determine the travel route. As this poor guy has ...
分类:其他好文   时间:2014-08-18 10:50:54    阅读次数:334
HDU 3001 Travelling (三进制状态压缩 DP)
题意:有 n 个city,可以选择任一城市作为起点,每个城市不能访问超过2次, 城市之间有权值,问访问全部n个城市需要的最小权值。 思路:因为每个城市可以访问最多两次,所以用三进制表示访问的状态。 详细见代码注释!!!! #include #include #include #include #include #include #includ...
分类:其他好文   时间:2014-08-14 01:38:07    阅读次数:244
BZOJ1616: [Usaco2008 Mar]Cow Travelling游荡的奶牛
1616: [Usaco2008 Mar]Cow Travelling游荡的奶牛Time Limit:5 SecMemory Limit:64 MBSubmit:762Solved:427[Submit][Status]Description奶牛们在被划分成N行M列(2 <= N <= 100; 2...
分类:其他好文   时间:2014-08-12 18:04:24    阅读次数:201
HDU 3001 Travelling 状压DP
三进制状压。调了一整天,一开始用记忆化搜索一直超时,后来改成了递推,代码能力真是弱。。后来瓜神提供了一个思路,如果建立一个超级源点然后用记忆化搜索的话,应该可以过。。。。#include #include #include #include #include #include #include #i...
分类:其他好文   时间:2014-08-12 16:20:24    阅读次数:199
hdu3001Travelling (状态压缩DP,三进制)
Travelling Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3611 Accepted Submission(s): 1132 Problem Description After coding so many days...
分类:其他好文   时间:2014-08-11 00:29:52    阅读次数:295
HDU 3001 Travelling
Description After coding so many days,Mr Acmer wants to have a good rest.So travelling is the best choice!He has decided to visit n cities(he insists on seeing all the cities!And he does not mind w...
分类:其他好文   时间:2014-07-30 17:37:14    阅读次数:306
Zoj 2027 Travelling Fee 最短路变形
给你一个图和AB,问你从A到B的路径中,当每条路径的最长的边长度忽略的情况下,A到B的最短路.建立两个矩阵,一个记录最大长度,一个是最短路,同步更新即可.#include #include #include #include #include #include #include #include #...
分类:其他好文   时间:2014-07-21 00:02:02    阅读次数:196
ZOJ 2027 Travelling Fee
枚举+最短路 题意是说出发地 和 目的地 之间有一条边是免费的。问你最小费用。 误区:求出最短路-路径中的最大边。(有些其他边免费之后,可能最短路就变了) 正确思路:枚举每条边,将其费用设为0.然后求最短路。找费用最小。 这是无向图,至于地名可以用map映射。 #include #include #include #include #include...
分类:其他好文   时间:2014-07-19 23:18:49    阅读次数:268
计算字符串的相似度
计算字符串的相似度 提出问题 许多程序会大量使用字符串。对于不同的字符串,我们希望能够有办法判断其相似程度。我们定义了一套操作方法来把两个不相同的字符串变得相同,具体的操作方法为: 1.修改一个字符(如把“a”替换为“b”)。 2.增加一个字符(如把“abdd”变为“aebdd”)。 3.删除一个字符(如把“travelling”变为“traveling”)。 比如,对于“abcdef...
分类:其他好文   时间:2014-05-24 19:32:33    阅读次数:289
HDU 3001 Travelling 状态DP
TSP问题,不懂就是每个点最多访问两次,最少访问一次。所以,我们可以用三进制来当做状态。这个题练习了一下三进制……0、1、2 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #...
分类:其他好文   时间:2014-05-06 11:56:54    阅读次数:342
130条   上一页 1 ... 11 12 13
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!