摘要:
拓扑排序 https://www.acwing.com/problem/content/850/ include include include include include using namespace std; const int N=1e5+10; int ver[N],head[N],n 阅读全文
posted @ 2020-04-16 20:50
arbor_one
阅读(113)
评论(0)
推荐(0)
摘要:
模板题 快速幂求矩阵的幂 https://www.luogu.com.cn/problem/P3390 include include include using namespace std; const int N = 110; long long n, k; const int mod = 10 阅读全文
posted @ 2020-04-15 20:13
arbor_one
阅读(265)
评论(0)
推荐(0)
摘要:
记录简单路径 并且求出路径权值的积 "原题链接" 下面附上模板 include include include include using namespace std; const int M=100010,N=100100; int d[N],Next[N],edge[M],head[N],tot 阅读全文
posted @ 2020-04-13 21:01
arbor_one
阅读(126)
评论(0)
推荐(0)
摘要:
spfa算法 o(nm) 适用的地方 权值可以为负的时候,也是单源最短路径的一个算法 include include include include include using namespace std; const int N=100100,M=1000010; queueq; int d[N] 阅读全文
posted @ 2020-04-09 21:06
arbor_one
阅读(135)
评论(0)
推荐(0)
摘要:
求单源最短路径 迪杰斯特拉算法 O(n n) inlcude include Include include using namespace std; int a[1000][1000],d[1000],n,m; bool v[1000]; void dijkstra() { memset(d,0f 阅读全文
posted @ 2020-04-09 16:05
arbor_one
阅读(123)
评论(0)
推荐(0)
摘要:
求有权无向图两点之间的最长距离 这是根据蓝桥杯大臣的旅费一题 看一位大佬写的 https://blog.dotcpp.com/a/7027 这个是链接 include include include include include using namespace std; int cnt,node, 阅读全文
posted @ 2020-04-08 20:01
arbor_one
阅读(524)
评论(0)
推荐(0)
浙公网安备 33010602011771号