Jogging Trails
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 2122
Accepted: 849
Description
Gord is training for a marathon. Behind his house is a park wit...
分类:
其他好文 时间:
2014-07-09 12:10:17
阅读次数:
229
解法有很多奇葩的地方,比如可以到达终点再跳回去再跳回来(比如有两个点)。。。。反正就是不能有最短路,不过没关系,算法都能给出正确结果
思想:和求最短路上的点套路一样,spfa先正着求一次,再反着求一次最短路,然后枚举每条边找dist_zheng[i] + len + dist_fan[j]的第二小值即可!注意不能用邻接矩阵,那样会MLE,应该用邻接表
/*
poj 3255
...
分类:
数据库 时间:
2014-07-09 11:28:13
阅读次数:
245
Highways
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 21315
Accepted: 9822
Description
The island nation of Flatopia is perfectly flat. Unfortunately,...
分类:
其他好文 时间:
2014-07-09 11:26:56
阅读次数:
177
Robot Motion
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 10280
Accepted: 5006
Description
A robot has been programmed to follow the instructions in...
分类:
其他好文 时间:
2014-07-09 11:24:57
阅读次数:
290
Robot Motion
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 10280
Accepted: 5006
Description
A robot has been programmed to follow the instructions in...
分类:
其他好文 时间:
2014-07-09 11:24:16
阅读次数:
196
Area
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 4725
Accepted: 2135
Description
Being well known for its highly innovative products, Merck would defin...
分类:
其他好文 时间:
2014-07-09 11:21:01
阅读次数:
234
本题也是找LCA的题目,不过要求多次查询,一般的暴力查询就必然超时了,故此必须使用更高级的方法,这里使用Tarjan算法。
本题处理Tarjan算法,似乎输入处理也挺麻烦的。
注意: 因为查询的数据会极大,故此使用一个数组记录所有查询数据就会超时的。我就载在这里了。查了好久才想到这点。因为我使用了一个vector容器记录了查询数据,故此每次都循环这组这么大的数据,就超时了。----解决办法:使...
分类:
其他好文 时间:
2014-07-09 11:08:22
阅读次数:
224
The Suspects
Time Limit: 1000MS
Memory Limit: 20000K
Total Submissions: 21365
Accepted: 10347
Description
Severe acute respiratory syndrome (SARS), an atypical pneu...
分类:
其他好文 时间:
2014-07-09 10:10:48
阅读次数:
131
Tiling
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 7454
Accepted: 3640
Description
In how many ways can you tile a 2xn rectangle by 2x1 or 2x2 tiles?
...
分类:
其他好文 时间:
2014-07-09 09:40:34
阅读次数:
249
Radar Installation
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 50843
Accepted: 11415
Description
Assume the coasting is an infinite straight line. La...
分类:
其他好文 时间:
2014-07-09 09:18:56
阅读次数:
243