3.7k3 分钟

分治NTT,套了个dls自动取模的整数板子,但常数过大。 #include <assert.h> #include <cstdio> #include <iostream> using namespace std; using ll = long long; const int NR = 1 << 21; const int G = 3, Gi = 332748118; const int mod = 998244353; template <int MOD, int RT> st
2.3k2 分钟

只需把上下界最小流跑的残量网络最大流起始点换成$s->t$,和可行流相加即可。 #include <cstdio> #include <cstring> #include <queue> using namespace std; const int N = 125100; int n, m, s, t, tot = 1, hd[(int)6e4], cur[(int)6e4], ss, tt, dep[(int)6e4]; long long flow[(int)6e4], l[N]; struct Edge {
3.8k3 分钟

头晕。。。 所以即求 其中 #include <cstdio> #include <iostream> #include <cmath> using namespace std; using ll = long long; const int N = 1 << 21; const int P = 998244353; const int G = 3, Gi = 332748118; const int mod = 998244353; int qmi(int a, int b
1.7k2 分钟

NTT那块还要再看一下。。。 #include <cstdio> #include <iostream> #include <cmath> typedef long long ll; const int NR = 1 << 22, g = 3, gi = 332748118, mod = 998244353; using namespace std; int n, m, rev[NR]; ll a[NR], b[NR],c[NR],d[NR]; ll quikpow(ll a, ll k) {
1.3k1 分钟

NTT的做法 ec好像是linux的机子,回头学下gdb调试 #include <cstdio> #include <iostream> #include <cmath> typedef long long ll; const int NR = 1 << 22, g = 3, gi = 332748118, mod = 998244353; using namespace std; int n, m, rev[NR]; ll a[NR], b[NR]; ll quikpow(ll a, ll k)