发现 dp 过程是可以压缩的,我们压缩掉一维,减小常数,即可通过本题。 #include<bits/stdc++.h> using namespace std; #define int long long const int N = 2000; const int B = 45; const int MOD = 998244353; int f[B + 2][N + 2], g[N + 2][N