BZOJ 1179 [Apio2009]Atm
2021-02-14 00:19
阅读:724
标签:back highlight max const lin cto iostream har namespace
题解:裸的缩点+最短路(DP)
#include#include #include #include #include using namespace std; const int maxn=500009; const int oo=1000000000; int n,m; int v[maxn]; int cntedge; int head[maxn]; int to[maxnG[maxn]; int dfsclock,scccnt; int pre[maxn],lowlink[maxn],sccno[maxn]; int S[maxn],top; void Dfs(int u){ pre[u]=lowlink[u]=++dfsclock; S[++top]=u; for(int i=0;i q; int inq[maxn]; int d[maxn]; void Spfa(){ for(int i=1;id[to[i]]){ d[to[i]]=d[x]+w[to[i]]; if(!inq[to[i]]){ inq[to[i]]=1; q.push(to[i]); } } } } } int main(){ scanf("%d%d",&n,&m); while(m--){ int x,y; scanf("%d%d",&x,&y); G[x].push_back(y); } for(int i=1;i
BZOJ 1179 [Apio2009]Atm
标签:back highlight max const lin cto iostream har namespace
原文地址:https://www.cnblogs.com/zzyer/p/8454335.html
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:BZOJ 1179 [Apio2009]Atm
文章链接:http://soscw.com/index.php/essay/55042.html
文章标题:BZOJ 1179 [Apio2009]Atm
文章链接:http://soscw.com/index.php/essay/55042.html
评论
亲,登录后才可以留言!