蓝桥杯训练 最短路 (SPFA模板 vector)...
分类:
其他好文 时间:
2015-04-08 07:57:57
阅读次数:
136
hdu2544 最短路径hdu2544 最短路径http://acm.hdu.edu.cn/status.php错误 1:inf 开太小错误 2:spfa 最后忘记了 inQue[u] = 0;错误 3:spfafor (int i = 1; i int n;int m;int g[105][105...
分类:
其他好文 时间:
2015-04-07 13:29:04
阅读次数:
154
Minimum Transport Cost
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 8083 Accepted Submission(s): 2104
Problem Description
These a...
分类:
其他好文 时间:
2015-04-05 18:55:33
阅读次数:
187
Problem Description
A certain local trucking company would like to transport some goods on a cargo truck from one place to another. It is desirable to transport as much goods as possible each trip. Unfortunately, one cannot always use the roads in the shor...
分类:
编程语言 时间:
2015-04-05 09:16:13
阅读次数:
208
背景:今晚在tyvj参加了一下比赛,没想到可耻的跪了。第一题地球人都知道spfa,结果我写了个坐标类DP还得了30分……悲剧。唯一欣慰的是我用组合数学做出了第二题,奠定了我们学校有五个人冲进前六的基础。先发第二题好了。题目:由于tyvj比较坑,比赛的题目竟然没了!只能说下大体意思。给定n个苹果,要求...
分类:
移动开发 时间:
2015-04-05 08:55:34
阅读次数:
122
Delay Constrained Maximum Capacity Path
Time Limit: 10000/10000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)
Total Submission(s): 1314 Accepted Submission(s): 418
Problem De...
分类:
其他好文 时间:
2015-04-01 21:59:13
阅读次数:
324
树的直径,即这棵树中距离最远的两个结点的距离。每两个相邻的结点的距离为1,即父亲结点与儿子结点或儿子结点与父子结点之间的距离为1.有趣的是,从树 的任意一个结点a出发,走到距离最远的结点b,再从结点b出发,能够走的最远距离,就是树的直径。树中相邻两个结点的距离为1。你的任务是:给定一棵树, 求这棵...
分类:
其他好文 时间:
2015-03-30 20:37:17
阅读次数:
147
题意:
给一个图和q个询问,每个询问查询图中两点的(距离+路径上最大值)的最小值。
分析:
枚举路径上的最大值做spfa,这题丫的卡常数。。。队列用stl的就等着tle吧。
代码:
//poj 4046
//sep9
#include
#define inf ((~(0ULL))>>1)
using namespace std;
const int maxN=1024;
const i...
分类:
其他好文 时间:
2015-03-30 09:26:43
阅读次数:
166
Invitation Cards
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 2374 Accepted Submission(s): 1151
Problem Description
In the age o...
分类:
其他好文 时间:
2015-03-29 21:04:10
阅读次数:
148