POJ PKU 1511 图论 高效最短路
(2010-07-21 12:38:02)
标签:
pojpku1511it |
分类: 图论 |
解题报告:
题目就不描述了。
就是求第一个点到其他点的最短距离和。(单源最短路)
再加上 其他所有点到第一个点的最短距离和。
点多,边多,spfa可过。
代码如下:
#include<iostream>
#include<cmath>
#include<cstdio>
#include<cstring>
using namespace std;
#define SIZE 1000001
struct edge{int to, value, next;}y[SIZE];
int t, v, e, x[SIZE], from, to, id, que[SIZE * 2], vst[SIZE];
int sta[SIZE][2], cnt;
long long d[SIZE];
long long spfa()
{
}
void insert(int from1, int to1, int va1)
{