测了十几份代码。
我说我就算菜这题也不能wa吧。
输出换行。
#include<bits/stdc++.h>
using namespace std;
bitset<10001> f(1);
int n, x;
int main() {
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
cin >> n;
for(int i = 0; i < n; ++ i) {
cin >> x;
f |= f << x;
}
cout << f.count() << '\n';
return 0;
}