11 2021 档案
摘要:鉴于fft的题在当今ICPC已经成为签到题了,还有很有必要掌握一些进阶应用。 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #define maxn 400005 #
阅读全文
摘要:#include<bits\stdc++.h> using namespace std; #define int long long void in(int &x){ int y=1;char c=getchar();x=0; while(c<'0'||c>'9'){if(c=='-')y=-1;c
阅读全文
摘要:存一下,可以用来对比找bug #include<bits\stdc++.h> using namespace std; #define int long long void in(int &x){ int y=1;char c=getchar();x=0; while(c<'0'||c>'9'){i
阅读全文
摘要:#include<bits\stdc++.h> using namespace std; const int N=600; const double eps= 1e-10; struct P{ double x,y; P(){x=y=0;} P(double _x,double _y){x=_x,y
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; #define N 1000010 const int mod = 1000000007; const int inf = 1000000007; const double eps = 1e-9; void i
阅读全文
摘要:注意,spfa可能被卡,图中存在负权 #include<bits/stdc++.h> using namespace std; #define int long long const int _ = 2e5+10; const int N = 1010,inf=0x3f3f3f3f; void in
阅读全文
摘要:原题 P2774 方格取数问题 题目描述 有一个 m 行 n 列的方格图,每个方格中都有一个正整数。现要从方格中取数,使任意两个数所在方格没有公共边,且取出的数的总和最大,请求出最大的和。 解法: 对图黑白染色。 加边: ①相邻黑白点 连边 边全inf ②S → 白点 边权为cost ③黑点 → T
阅读全文
摘要:GarsiaWachs算法 一个算法,证明网上没找到。 求石子合并问题的优化。 step1: 找出第一个 a_k-1 < a_k+1 step2: 合并a_k-1 + a_k = TmpA step3: 将TmpA移动至数组中第一个大于TmpA的数的后面。 step4: 迭代至数组收敛。 原题石子合
阅读全文
摘要:模拟退火算法 原题 luoguP1337 题意: #include <iostream> #include <cmath> #include <cstdio> #define abs(x) ((x) >= 0 ? (x) : (-(x))) using namespace std; int n; d
阅读全文
摘要:// 一种简单而美的算法 匈牙利交朋友算法求最大匹配, #include<bits/stdc++.h> using namespace std; const int _ = 1e6+10; vector<int>g[_];//向量存边 int b[_],f[_];//b==vis,表示在当前伦次下是
阅读全文
摘要:ISAP是的dicnic基础上优化得到的一直最大流算法,其包含了当前弧优化和分层图优化,且分层图无需重新构建,会在运行过程中处理。 ISAP 的终止条件为出现断层div。 对于层数 > div 的点,满流。 反之,则未满流。 在最大全闭合图问题中,答案为满流的点的组合。 #include<bits/
阅读全文

浙公网安备 33010602011771号