用户输出
34
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#63251 | #1121. jwp的幸运集合(弱化版) | Accepted | 100 | 203 ms | 360 K | C++ 11 / 319 B | lyh | 2021-07-21 15:08:00 |
#include <bits/stdc++.h>
using namespace std;
int n;
int num[30];
int count1;
int main() {
cin >> n;
for (int i = 0; i < n; i++) cin >> num[i];
for (int i = 1; i < (1 << n); i++) {
int c = 0, sum = 0;
for (int j = 0; j < n; j++) {
if (i & (1 << j)) {
sum += num[j];
c++;
}
}
if (c % 2 == 0 && sum == 0)
count1++;
}
cout << count1;
return 0;
}
用户输出
34
系统信息
Exited with return code 0
用户输出
69
系统信息
Exited with return code 0
20
50000000 -50000000 50000000 -50000000 50000000 -50000000 50000000 -50000000 50000000 -50000000 50
<93 bytes omitted>
用户输出
184755
系统信息
Exited with return code 0
20
50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 5000000
<82 bytes omitted>
用户输出
0
系统信息
Exited with return code 0
用户输出
255
系统信息
Exited with return code 0