10 2019 档案
摘要:生命算法,以防忘记 #include<bits/stdc++.h> using namespace std; int head[200005],dis[200005],n,m,s,f,g,w,l; bool sign[200005]; struct node { int to,next,val; }
阅读全文
摘要:SPFA可以处理带负边权的图,可以判负环,然而SPFA容易被卡,即使加了各种优化。 队列优化的贝尔福德曼:裸SPFA //SPFA #include<bits/stdc++.h> using namespace std; int head[1000005],d[1000005],l,n,m,s; b
阅读全文