摘要: #include<iostream> #include<algorithm> #include<stack> #include<map> using namespace std; stack<char>st; map<char, int>Rank;//进行优先级比较 int main() { Ran 阅读全文
posted @ 2024-01-22 16:30 敲代码的6 阅读(17) 评论(0) 推荐(0)
摘要: 当且仅当图中不含奇数环 由于图中没有奇数环,所以染色过程没有矛盾 染色法 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N=100010,M=200010; int n, 阅读全文
posted @ 2023-11-07 19:21 敲代码的6 阅读(25) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N=100010,M=200010,INF=0x3f3f3f3f; int p[N];int n,m;int cnt=0,r 阅读全文
posted @ 2023-11-06 20:12 敲代码的6 阅读(28) 评论(0) 推荐(0)
摘要: 到集合得最短距离是指点到集合中的所有点最短距离,集合就是遍历或正选中的数 prim #include<iostream> #include<cstring> #include<algorithm> using namespace std; int n,m; const int N=510 ;cons 阅读全文
posted @ 2023-11-02 22:33 敲代码的6 阅读(27) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstring> #include<algorithm> #include<queue> using namespace std; const int N=100010; int n,m; int h[N]; int ne[N];int e[N 阅读全文
posted @ 2023-11-01 21:15 敲代码的6 阅读(30) 评论(0) 推荐(0)
摘要: struct Edge//存放边 { int a,b,w; }edges[M]; edges[i]={a,b,w}; //结构体经典赋值方式#include<iostream> #include<cstring> #include<algorithm> using namespace std; co 阅读全文
posted @ 2023-10-31 21:16 敲代码的6 阅读(15) 评论(0) 推荐(0)
摘要: n是点数 m是边数 退优化版的适合点数和边数差不多 (3)适合对边有限制 稠密图用邻接矩阵存 稀疏图用邻接表来存 朴素dijkstra #include<cstring> #include<iostream> using namespace std; int n,m; const int N=510 阅读全文
posted @ 2023-10-25 21:59 敲代码的6 阅读(23) 评论(0) 推荐(0)
摘要: (1)有些比赛问题可以用公式直接计算,仔细辨别,不要盲目计算 (2)注重时间复杂度的分析,估算时间,选择合适的算法或者其他解题方式 时间复杂度 (3)对于出错的题目先跳过,一直提交可能会蒙圈,返回来再写时可能会清晰些 阅读全文
posted @ 2023-10-18 21:18 敲代码的6 阅读(35) 评论(0) 推荐(0)
摘要: 拓扑排序 https://raelum.blog.csdn.net/article/details/129650604?ydreferer=aHR0cHM6Ly93d3cuYWN3aW5nLmNvbS9hY3Rpdml0eS9jb250ZW50L2NvZGUvY29udGVudC80NzEwNi8% 阅读全文
posted @ 2023-10-18 20:59 敲代码的6 阅读(141) 评论(0) 推荐(0)
摘要: #include<iostream> #include<queue> #include<cstring> using namespace std; const int N = 1000010; int h[N],e[N], ne[N], idx=0; int d[N]; int m, n; queu 阅读全文
posted @ 2023-10-12 10:38 敲代码的6 阅读(17) 评论(0) 推荐(0)