摘要:
http://poj.org/problem?id=3463题意 给出一个图 若次短路比最短路多1 则输出 最短路的条数+次短路的条数否则输出 最短路的条数#include#include#include#includeusing namespace std;#define INF 100000000struct E{int to;int next;int len;}edge[20004];int vis[1014][2],d[1012][2],dp[1012][2],adj[1002],num;void dij(int s,int n){ int i,j,flag; memset... 阅读全文
摘要:
http://poj.org/problem?id=3013求最短路n#include#include#includeusing namespace std;//#define INF 20000000000const long long INF=(long long) 1 q;void add(int a,int b,int c){ edge[num].to =b; edge[num].next=adj[a]; edge[num].len =c; adj[a]=num++;}void spfa(int s,int n){ int i,a,b; for(i=... 阅读全文