Loading

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 25 下一页
摘要: 网络流入门到入土(#1) 最大流: 裸最大流: P1343 地震逃生 #pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; //const int maxm = 阅读全文
posted @ 2020-08-02 14:22 ViKyanite 阅读(174) 评论(2) 推荐(0) 编辑
摘要: Dinic模板 上界O(N*M2) 二分图用 #pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 10; const int maxm = 1e5 * 2 + 10; 阅读全文
posted @ 2020-07-25 21:53 ViKyanite 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 二分图最大匹配: hopcroft-carp算法 O(sqrt(n)m) (算是改进版的匈牙利算法吧 #include <bits/stdc++.h> using namespace std; const int maxn = 501; const int maxm = 250001; const 阅读全文
posted @ 2020-07-14 19:48 ViKyanite 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 题目链接:kuangbin专题 dijk: 1 7 4 10 3 2 16 spfa:14 12 13 5 15 18 floyd:8 6 9 差分约束:19 11 最后剩下一个第17题,涉及网络流,留在网络流专题做。 这是我做完一遍之后觉得比较好的做题顺序,一个一个知识点学习,每个知识点大致上由易 阅读全文
posted @ 2020-07-14 16:05 ViKyanite 阅读(65) 评论(0) 推荐(0) 编辑
摘要: #pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e5 + 100; const int maxm = 1e6 + 100; co 阅读全文
posted @ 2020-07-11 20:18 ViKyanite 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 最近一直在做图论的题目。对于初始化的效率要求比较高。正巧我也对这三个函数不是很清楚。 就写了个测试程序来测试效率 测试程序: #include <bits/stdc++.h> //#pragma GCC optimize(2) using namespace std; #define max 100 阅读全文
posted @ 2020-07-10 12:38 ViKyanite 阅读(1049) 评论(0) 推荐(0) 编辑
摘要: 其实我个人非常喜欢DLX. 因为我认为他较为简单——建模 + DLX = AC! 这里先分享一套我较为常用的模板: const int N = 9; const int maxn = N*N*N + 10; const int maxnode=maxn*4+maxn+10; const int IN 阅读全文
posted @ 2020-07-05 11:02 ViKyanite 阅读(346) 评论(0) 推荐(0) 编辑
摘要: 这个模板是我在某谷上看到的。觉得写得挺有通用性得,就嫖过来的。 原博客网址。 //整数二分答案 while(left <= right) { int mid = (left + right) / 2; if(judge(mid)) { left = mid + 1; ans = max(ans, m 阅读全文
posted @ 2020-07-04 10:36 ViKyanite 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 最近考完试了。闲下来就正好刷刷以前没刷完的搜索专题。 简单搜索就没啥好讲的啦。就是暴力bfs和dfs。 这篇博客是kuangbin搜索进阶的专题的总结 八数码问题太经典啦。通过它来学习搜索的进阶技巧就很舒服。 首先是最简单的康拓优化。 康托展开(Hash序列权值,可以用于序列打表: int jc[1 阅读全文
posted @ 2020-06-23 21:48 ViKyanite 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 数论: 快速乘: ll ModMul(ll a,ll b,ll n){//快速积取模 a*b%n ll ans=0; while(b){ if(b&1) ans=(ans+a)%n; a=(a+a)%n; b>>=1; } return ans; } 快速幂: ll ModExp(ll a,ll b 阅读全文
posted @ 2020-06-13 21:51 ViKyanite 阅读(188) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 25 下一页