BZOJ 1179 [Apio2009]Atm
标签: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;iq;
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
评论