摘要:
组合数 ll inv[N],inc[N]; void init(){ inc[0]=1; for(int i=1;i<=N;i++){ inc[i]=inc[i-1]*i % mod; } inv[0]=1; for(int i=1;i<=N;i++){ inv[i]=powmod(inc[i],m 阅读全文
posted @ 2024-03-21 21:33
Miburo
阅读(14)
评论(0)
推荐(0)
摘要:
哈希 typedef unsigned long long ULL; const int N = 1000010, P = 131; int n, m; string s; ULL p[N], h[N]; void init(){ p[0] = 1, h[0] = 0; string pys = " 阅读全文
posted @ 2024-03-21 19:56
Miburo
阅读(6)
评论(0)
推荐(0)
摘要:
拓扑排序 #include <bits/stdc++.h> using namespace std; constexpr int N = 100010; int n, m, a, b; vector<int> e[N], tp; int din[N]; bool toposort(){ queue< 阅读全文
posted @ 2024-03-21 19:50
Miburo
阅读(20)
评论(0)
推荐(0)
摘要:
树状数组: template<typename T> struct BIT{ T a[N]; int size = N; void init(int s){ size = s; for(int i = 0; i <= s; i++){ a[i] = 0; } } T query(int x){ as 阅读全文
posted @ 2024-03-21 19:36
Miburo
阅读(16)
评论(0)
推荐(0)

浙公网安备 33010602011771号