上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 63 下一页
摘要: //稠密图 #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N = 100010, M = 200010, INF = 0x3f3f3f3f; int n, m; i 阅读全文
posted @ 2019-11-13 01:38 晴屿 阅读(189) 评论(0) 推荐(0)
摘要: //不存在负权回路 //边权可能为负数 #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N = 210, INF = 1e9; int n, m, Q; int d[ 阅读全文
posted @ 2019-11-12 15:05 晴屿 阅读(153) 评论(0) 推荐(0)
摘要: #include <cstring> #include <iostream> #include <algorithm> #include <queue> using namespace std; const int N = 100010; int n, m; int h[N], w[N], e[N] 阅读全文
posted @ 2019-11-12 15:04 晴屿 阅读(218) 评论(0) 推荐(0)
摘要: //存在负权值 处理负环 //如果能求出来 一般是不存在负权回路 //如果有负回路 那最小距离可能是负无穷 #include <cstring> #include <iostream> using namespace std; const int N = 1e4+1; struct Edge { i 阅读全文
posted @ 2019-11-12 15:04 晴屿 阅读(158) 评论(0) 推荐(0)
摘要: #include <cstring> #include <iostream> #include <algorithm> #include <queue> using namespace std; const int N = 2010, M = 10010; int n, m; int h[N], w 阅读全文
posted @ 2019-11-12 15:04 晴屿 阅读(185) 评论(0) 推荐(0)
摘要: //稀疏图 点和边差不多 #include <cstring> #include <iostream> #include <algorithm> #include <queue> using namespace std; typedef pair<int, int> PII; const int N 阅读全文
posted @ 2019-11-12 15:03 晴屿 阅读(216) 评论(0) 推荐(0)
摘要: //朴素Dijkstra 边权都是正数 稠密图:点和边差的比较多 #include<cstring> #include<iostream> #include<algorithm> using namespace std; const int N = 510; int n, m; int g[N][N 阅读全文
posted @ 2019-11-12 15:02 晴屿 阅读(235) 评论(0) 推荐(0)
摘要: 模拟队列 #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N = 100010; int n, m; int h[N], e[N], ne[N], idx;//邻接表 阅读全文
posted @ 2019-11-10 21:37 晴屿 阅读(237) 评论(0) 推荐(1)
摘要: 队列 #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include <queue> using namespace std; const int N = 100010; int n, m; 阅读全文
posted @ 2019-11-10 21:36 晴屿 阅读(178) 评论(0) 推荐(0)
摘要: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N = 100010, M = N * 2; int n; int h[N], e 阅读全文
posted @ 2019-11-10 21:35 晴屿 阅读(192) 评论(0) 推荐(0)
上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 63 下一页