After some thought on where to spend a holiday Vova decided to travel around South China and visit Guangzhou, Shenzhen, Macau and Hong Kong.
Vova heard that South China speaks the Cantonese dia...
分类:
其他好文 时间:
2015-04-19 22:51:16
阅读次数:
241
Travel
Time Limit: 10000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1847 Accepted Submission(s): 623
Problem Description
One day, Tom trav...
分类:
其他好文 时间:
2015-04-18 20:39:59
阅读次数:
180
首先用Dijkstra做出最短路生成树,设dis[p]为1到p点的最短路长度对于一条不在生成树上的边u -> v,不妨设fa为u、v的lca则一fa到v的路径上的任意点x都可以由u达到,走的方式是1 -> fa -> u -> v -> x,dis'[x] = dis[u] + dis(u, v) ...
分类:
其他好文 时间:
2015-04-17 23:34:19
阅读次数:
176
Bus Pass
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 750 Accepted Submission(s): 302
Problem Description
You travel a lot by bu...
分类:
其他好文 时间:
2015-04-15 13:29:20
阅读次数:
118
A. Arbitrage?
Time Limit: 5000ms
Memory Limit: 65536KB
64-bit integer IO format: %lld Java class name:
Main
Submit
Status
PID: 4291
If you are going to travel to the World Fi...
分类:
其他好文 时间:
2015-04-13 20:57:26
阅读次数:
136
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].
You have a car with an unlimited gas tank and it costs cost[i] of gas to travel
from station i to ...
分类:
其他好文 时间:
2015-04-13 09:34:53
阅读次数:
145
思路:把所有最短路找出来,然后跑一次就好了。把所有最短路找出来大概就是,把边反向,然后从e跑最短路。然后正向从s跑最短路。然后从s开始,每次跟着最短路(字典序最小)走。判断一条边是不是最短路,也就是dis[u]+d[v]+hehe=D#include#include#include#include#...
分类:
其他好文 时间:
2015-03-21 01:00:20
阅读次数:
281
题意:
给出 一个图
点与点之间的路径上有两个权值 路径长度和温度
要求在所走路径中的温度的最大值最小的前提下 走最短路径
解题思路1:
首先用 最小生成树 的方法走出 最小瓶颈路 ,把在这期间用到的所有温度小于 路径上最大温度 的边存下来,作为接下来求最短路径的图;
在新生成的图中求最短路径即可;
code
#include
#include
#include
#include...
分类:
其他好文 时间:
2015-03-19 16:19:36
阅读次数:
177
A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a progra...
分类:
其他好文 时间:
2015-03-11 00:41:44
阅读次数:
142