摘要:
#include<bits/stdc++.h> using namespace std; int head[2000000],d[500005],lg[500005],fa[500005][25],l,n,m,s,x,y; struct node { int to,next; } a[2000000 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; unsigned long long n,z1=1331,z2=10000019,a[10005],ans=1; char ch[10005][1505]; unsigned long long hashh(i 阅读全文
摘要:
模板题 还有6天CSP-S,慌得一批 #include<bits/stdc++.h> using namespace std; int head[3000005],v[3000005],n,sum,l,end[3000005],rdu[3000500]; queue<int>q; struct no 阅读全文
摘要:
SPFA可以处理带负边权的图,可以判负环,然而SPFA容易被卡,即使加了各种优化。 队列优化的贝尔福德曼:裸SPFA //SPFA #include<bits/stdc++.h> using namespace std; int head[1000005],d[1000005],l,n,m,s; b 阅读全文