最唐的一集
查看原帖
最唐的一集
963559
Lu_xZ楼主2024/3/12 01:27

测了十几份代码。

我说我就算菜这题也不能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;
}
2024/3/12 01:27
加载中...