用户输出
34
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#53725 | #1121. jwp的幸运集合(弱化版) | Accepted | 100 | 242 ms | 356 K | C++ 17 / 525 B | q3540555 | 2021-07-07 21:08:40 |
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
long long int arr[20];
for (int i = 0; i < n; i++) cin >> arr[i];
long long int count = 0;
for (int i = 1; i < (1 << n); i++) {
long long int sum = 0;
int c = 0;
for (int j = 0; j < n; j++) {
if (i & (1 << j)) {
sum += arr[j];
c++;
}
}
if (c % 2 == 0 && sum == 0)
count++;
}
cout << count;
}
用户输出
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