摘要: 最好还是看一看下面这个网址吧 我的这篇博客里的代码更加缜密(毫无错误的神级代码)https://www.cnblogs.com/Tidoblogs/p/11315153.html https://www.sohu.com/a/245954819_100201031 阅读全文
posted @ 2019-07-21 22:29 DreamingBligo_Tido 阅读(130) 评论(0) 推荐(0) 编辑
摘要: CF449B Jzzhu and Cities 其实这一道题并不是很难,只是一个最短路而已,请继续看我的题解吧~(^▽^) AC代码: #include<bits/stdc++.h> #define maxn 3000005 #define pa pair<long long,long long> 阅读全文
posted @ 2019-07-21 20:45 DreamingBligo_Tido 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 拓扑排序 拓扑图:有向⽆环图 在拓扑序中,所有指向x点的边的起点,都在x点之前。 伪代码: 将⼊度为0的点加⼊队列 while(l<r){ int x=q[++l]; for(int i=point[x];i;i=next[i]) //这是邻接表的写法,也可以转化为vector { in[to[i] 阅读全文
posted @ 2019-07-21 19:27 DreamingBligo_Tido 阅读(447) 评论(0) 推荐(0) 编辑
摘要: SPFA判负环 BFS 当⼀个点⼊队超过n次 则存在负环 慢! DFS 当⼀个点在最短路中出现两次 快! 阅读全文
posted @ 2019-07-21 19:24 DreamingBligo_Tido 阅读(156) 评论(0) 推荐(0) 编辑
摘要: // // dijkstra妯℃澘.cpp // algorithm // // Created by david.xu on 2018/8/6. // Copyright 漏 2018骞?david.xu. All rights reserved. //当一个点入队超过n次则存在负环BFS //快:DFS当一个点在最短路中出现两次 #include #include #incl... 阅读全文
posted @ 2019-07-21 19:20 DreamingBligo_Tido 阅读(225) 评论(0) 推荐(0) 编辑
摘要: // // dijkstra妯℃澘.cpp // algorithm // // Created by david.xu on 2018/8/6. // Copyright 漏 2018骞?david.xu. All rights reserved. // //不能有负边权! #include #include #include #include #include #incl... 阅读全文
posted @ 2019-07-21 19:19 DreamingBligo_Tido 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 伪代码: 阅读全文
posted @ 2019-07-21 16:59 DreamingBligo_Tido 阅读(475) 评论(0) 推荐(0) 编辑
摘要: int gcd(int a,int b) { if(b==0) return a; return gcd(b,a%b); } 阅读全文
posted @ 2019-07-21 00:17 DreamingBligo_Tido 阅读(97) 评论(0) 推荐(0) 编辑
摘要: //应用条件:不能修改! 阅读全文
posted @ 2019-07-21 00:13 DreamingBligo_Tido 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 求x^n 阅读全文
posted @ 2019-07-21 00:07 DreamingBligo_Tido 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-07-21 00:05 DreamingBligo_Tido 阅读(172) 评论(0) 推荐(0) 编辑
摘要: int l=0,r=inf; while(l>1; if(pd(mid)){ ans=mid; r=mid-1; } else l=mid+1; } 阅读全文
posted @ 2019-07-21 00:02 DreamingBligo_Tido 阅读(127) 评论(0) 推荐(0) 编辑