摘要: // 一种简单而美的算法 匈牙利交朋友算法求最大匹配, #include<bits/stdc++.h> using namespace std; const int _ = 1e6+10; vector<int>g[_];//向量存边 int b[_],f[_];//b==vis,表示在当前伦次下是 阅读全文
posted @ 2021-11-06 19:44 yesuweiYYYY 阅读(62) 评论(0) 推荐(0) 编辑
摘要: ISAP是的dicnic基础上优化得到的一直最大流算法,其包含了当前弧优化和分层图优化,且分层图无需重新构建,会在运行过程中处理。 ISAP 的终止条件为出现断层div。 对于层数 > div 的点,满流。 反之,则未满流。 在最大全闭合图问题中,答案为满流的点的组合。 #include<bits/ 阅读全文
posted @ 2021-11-04 15:03 yesuweiYYYY 阅读(62) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> #define maxn 100006 #define maxm 200006 #define lowbit(x) (x&-x) using namespace std; inline char nc(){ static char buf[100000 阅读全文
posted @ 2021-10-16 09:44 yesuweiYYYY 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 逆十字巨巨的代码 保存一下 #include<bits/stdc++.h> using namespace std; vector<int> v1[300010],v2[300010];//两张图 int T,n,x,y,dep[300010],rt[300010],tot,L[300010],R[ 阅读全文
posted @ 2021-08-09 09:53 yesuweiYYYY 阅读(22) 评论(0) 推荐(0) 编辑
摘要: // luogu-judger-enable-o2· /*( ntt 模板 luogu P3803 in: n , m 0,...,a[n] 0,...,b[m] example: 1 2 1 2 1 2 1 1 4 5 2 */ #include<iostream> #include<cstdio 阅读全文
posted @ 2021-07-23 14:43 yesuweiYYYY 阅读(37) 评论(0) 推荐(0) 编辑
摘要: // luogu-judger-enable-o2 /*( FFT 模板 luogu P3803 in: n , m 0,...,a[n] 0,...,b[m] example: 1 2 1 2 1 2 1 1 4 5 2 */ #include<iostream> #include<cstdio> 阅读全文
posted @ 2021-07-20 23:14 yesuweiYYYY 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 最大子矩阵问题--悬线法dp problem:搜索全为1的最大子矩阵 #include<bits/stdc++.h> using namespace std; const int N = 2010; const int inf = 1000000007; void in(int &x){ x=0;c 阅读全文
posted @ 2021-04-24 13:59 yesuweiYYYY 阅读(48) 评论(0) 推荐(0) 编辑
摘要: tarjan 模板 int low[N],dfn[N],Stack[N],belong[N]; //最小下表,时间戳,一个用数组模拟的栈 //belong[x]表示x所属的强连通分量的编号 int idx,top;//,动态时间戳,栈顶 int scc; //scc表示强连通分量的个数 bool i 阅读全文
posted @ 2021-04-23 08:56 yesuweiYYYY 阅读(52) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; struct window{ long long u; bool top; long long cnt; bool operator == (const window &t)const{ return u == 阅读全文
posted @ 2021-04-21 23:34 yesuweiYYYY 阅读(61) 评论(0) 推荐(0) 编辑
摘要: Gym324843D 交互,构造。 题意: 在106 * 106的平面中,存在n个点。 你每次询问(x,y) 系统会高呼你一个D,为(x,y)到最近的点的距离的平方。 每当你找到一个点的准确位置以后,当你继续查找时,系统不会再考虑这个点了。 解: 1.随便查询一个点(x,y),得到一个d 2.继续查 阅读全文
posted @ 2021-04-17 20:53 yesuweiYYYY 阅读(44) 评论(0) 推荐(0) 编辑