用户输出
34
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#31764 | #1121. jwp的幸运集合(弱化版) | Accepted | 100 | 43 ms | 356 K | C++ 17 / 528 B | 2n8asm | 2020-07-05 11:31:15 |
#ifdef D
#include "hpp.hpp"
#else
#include <bits/stdc++.h>
#endif
using namespace std;
vector<int> a;
int n;
int dfs(int step, int size, int sum) {
if (step == n - 1) {
if (size & 1) {
return sum + a[step] == 0;
}
return sum == 0;
}
return dfs(step + 1, size + 1, sum + a[step]) + dfs(step + 1, size, sum);
}
int main() {
cin >> n;
a.resize(n);
copy_n(istream_iterator<int>(cin), n, a.begin());
cout << dfs(0, 0, 0) - 1;
}
用户输出
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