http://www.lydsy.com/JudgeOnline/problem.php?id=1003 题意: 思路: 首先用spfa计算一下任意两天之内的最短路,dis[a][b]表示的就是在第a天~第b天从1到m的最短路。 接下来就是dp了,f[i]表示前i天的最小代价,那么状态转移方程就是: ...
分类:
其他好文 时间:
2017-08-05 00:13:48
阅读次数:
176
Flight Recently, Shua Shua had a big quarrel with his GF. He is so upset that he decides to take a trip to some other city to avoid meeting her. He wi ...
分类:
其他好文 时间:
2017-08-04 19:41:34
阅读次数:
146
Invitation Cards In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They ...
分类:
其他好文 时间:
2017-08-04 19:25:55
阅读次数:
181
http://codeforces.com/gym/100269/attachments 首先建图,然后图中每条边的权值是会变化的,是由dis[x] + dis[y] > dis[make],然后就相当于新增加一个原点0,求0到1的最短距离 #include <bits/stdc++.h> #def ...
分类:
其他好文 时间:
2017-08-04 16:47:37
阅读次数:
183
给你一个4个点的环,问你从2号点出发, 再回到2号点,长度>=K的最短路是多少。环上的边长度不超过30000。 跑出来所有dis(2,j)以后,然后for一遍j,根据dis(2,j)+t*2*w>=K,解出来对于每个j而言最小的t,然后尝试更新答案即可。如果dis(2,j)已经大于等于K了,那直接用 ...
分类:
其他好文 时间:
2017-08-03 23:38:53
阅读次数:
539
Idiomatic Phrases Game Tom is playing a game called Idiomatic Phrases Game. An idiom consists of several Chinese characters and has a certain meaning. ...
分类:
其他好文 时间:
2017-08-03 15:40:52
阅读次数:
162
题目描述 作为对奶牛们辛勤工作的回报,Farmer John决定带她们去附近的大城市玩一天。旅行的前夜,奶牛们在兴奋地讨论如何最好地享受这难得的闲暇。 很幸运地,奶牛们找到了一张详细的城市地图,上面标注了城市中所有L(2 <= L <= 1000)座标志性建筑物(建筑物按1..L顺次编号),以及连接 ...
分类:
其他好文 时间:
2017-08-03 15:40:34
阅读次数:
119
1、Til the Cows Come Home POJ 2387 题意:找到从N到1的最短路径。 思路:SPFA。 1 #include<iostream> 2 #include<vector> 3 #include<queue> 4 using namespace std; 5 const in ...
分类:
其他好文 时间:
2017-08-02 14:25:12
阅读次数:
182
Skiing Skiing Bessie and the rest of Farmer John's cows are taking a trip this winter to go skiing. One day Bessie finds herself at the top left corne ...
分类:
其他好文 时间:
2017-08-01 23:02:37
阅读次数:
227
XYZZY Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5804 Accepted Submission(s): 1681 Problem D ...
分类:
其他好文 时间:
2017-08-01 14:31:25
阅读次数:
124