传送门:https://loj.ac/problem/515 [题解] 容易发现S最大到1000000. 于是我们有一个$O(n^2*S)$的dp做法. 容易发现可以被bitset优化. 于是复杂度就是$O(\frac{n^2S}{32})$ 然后……就过了 # include <bitset> # include <stdio.h> # include <string.h> # include <iostream> # include <algori…
题目友链:https://loj.ac/problem/515 话说这题蛮简单,bitset暴力直接过. 话不多说,上代码! #include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 10; int n, a, b; bitset<maxn> f[110]; int main() { cin >> n; f[0].set(0); for (int i = 1; i <= n; i++)…