摘要:
一开始题目没看清楚,以为是增加那条边后还有多少桥,所以就当做是无向图tarjan缩点后建树,然后求u,v的最近公共祖先,一直wa。后来再看题目后才发现边放上去后不会拿下来了,即增加i条边后桥的数量。#include #include #include #include using namespace std;const int maxn = 100100;const int maxm = 200100;struct node{ int v,next;}edge[maxm*2];int head[maxn],low[maxn],dfn[maxn],fa[maxn],stack[maxn]... 阅读全文
posted @ 2013-07-30 23:36
一生挚爱
阅读(248)
评论(0)
推荐(0)
摘要:
/*** 题目要求过最少k条边的最短路*/#include #include #include #include #include using namespace std;const int maxn = 5010;const int maxm = 200010;const int INF = 1que; tmp.v = s,tmp.num = 0; dp[tmp.v][tmp.num] = 0; vis[tmp.v][tmp.num] = 1; que.push(tmp); while( !que.empty()){ now = que.front... 阅读全文
posted @ 2013-07-30 10:32
一生挚爱
阅读(288)
评论(0)
推荐(0)

浙公网安备 33010602011771号