12 2021 档案

摘要:1 #include <iostream> 2 #include <cstdio> 3 #include <cmath> 4 #include <cstring> 5 using namespace std; 6 7 typedef long long LL; 8 const int MAXN=10 阅读全文
posted @ 2021-12-05 09:57 Hell0er 阅读(41) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <vector> 5 using namespace std; 6 7 const int MAXN=(int)6e3+10; 8 9 int n; 1 阅读全文
posted @ 2021-12-05 09:51 Hell0er 阅读(33) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 3 using namespace std; 4 5 const int MAXN=110; 6 7 int n; 8 int a[MAXN*2]; 9 int dp[MAXN*2][MAXN*2]; 10 11 int main() 12 { 13 阅读全文
posted @ 2021-12-05 09:38 Hell0er 阅读(30) 评论(0) 推荐(0) 编辑
摘要:多重背包转01背包 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <vector> 5 using namespace std; 6 7 const int MAXN=1010; 8 9 int n 阅读全文
posted @ 2021-12-05 09:32 Hell0er 阅读(24) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 3 using namespace std; 4 5 typedef long long LL; 6 const int MAXN=200010; 7 const int MOD=(int)1e9+7; 8 int F[MAXN],Finv[MAXN] 阅读全文
posted @ 2021-12-04 22:20 Hell0er 阅读(35) 评论(0) 推荐(0) 编辑
摘要:1.gcd __gcd(a,b) 头文件<algorithm> 1 LL gcd(LL a,LL b) 2 { 3 LL t; 4 while (b) 5 { 6 t=b; 7 b=a%b; 8 a=t; 9 } 10 return a; 11 } 2.lcm 1 lcm=a/gcd(a,b)*b 阅读全文
posted @ 2021-12-04 22:15 Hell0er 阅读(53) 评论(0) 推荐(0) 编辑
摘要:pow()返回double,有精度误差 1.快速幂 1 LL qpow(LL a,LL b,LL MOD) //pow(a,b)%MOD 2 { 3 LL ret=1; 4 while (b) 5 { 6 if (b & 1) ret=(ret*a)%p; 7 a=(a*a)%p; 8 b>>=1; 阅读全文
posted @ 2021-12-04 22:11 Hell0er 阅读(23) 评论(0) 推荐(0) 编辑
摘要:1.欧拉筛 1 #include <iostream> 2 #include <cmath> 3 using namespace std; 4 typedef long long ll; 5 const int MAXN=1000010; 6 const int MAXV=50010; 7 8 ll 阅读全文
posted @ 2021-12-04 22:05 Hell0er 阅读(26) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 3 using namespace std; 4 5 const int MAXN=100010; 6 const int MAXM=100010; 7 8 struct Edge 9 { 10 int to,next,w; 11 }e[MAXM*2] 阅读全文
posted @ 2021-12-04 21:46 Hell0er 阅读(46) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 #include <algorithm> 3 using namespace std; 4 5 const int MAXN=100010; 6 7 struct Blanket 8 { 9 int area1,area2; 10 int beauty 阅读全文
posted @ 2021-12-04 21:43 Hell0er 阅读(3) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 #include <queue> 3 using namespace std; 4 5 typedef long long ll; 6 const int MAXSIZE=210; 7 const int INF=(int)1e9; 8 9 int m 阅读全文
posted @ 2021-12-04 21:36 Hell0er 阅读(32) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 #include <queue> 3 using namespace std; 4 typedef long long ll; 5 6 const int MAXN=100100; 7 const int MAXM=500100; 8 const in 阅读全文
posted @ 2021-12-04 21:27 Hell0er 阅读(56) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 #include <cstdio> 3 #include <cstdlib> 4 using namespace std; 5 6 typedef long long ll; 7 const int MAXN=100010; 8 const int M 阅读全文
posted @ 2021-12-04 21:16 Hell0er 阅读(31) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 #include <cstdio> 3 using namespace std; 4 5 const int MAXN=500010; 6 7 int n,m,s; 8 int fa[MAXN][20]; //结点i往上2^j的祖先 9 int dep 阅读全文
posted @ 2021-12-04 21:08 Hell0er 阅读(32) 评论(0) 推荐(0) 编辑
摘要:1. 头文件<algorithm> lower_bound(first,last,val) //在[first,last)区域内查找不小于 val 的第一个元素的地址 upper_bound(first,last,val) //在[first,last)区域内查找大于 val 的第一个元素的地址 2 阅读全文
posted @ 2021-12-04 20:52 Hell0er 阅读(34) 评论(0) 推荐(0) 编辑