记录编号 |
569237 |
评测结果 |
AAAAAAA |
题目名称 |
集合平分 |
最终得分 |
100 |
用户昵称 |
lihaoze |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.000 s |
提交时间 |
2022-02-25 21:05:36 |
内存使用 |
0.00 MiB |
显示代码纯文本
- #include <iostream>
- #include <algorithm>
- #include <cstring>
- #define OPEN(_x) freopen(#_x".in", "r", stdin); freopen(#_x".out", "w", stdout)
-
- using namespace std;
-
- typedef long long ll;
-
- inline ll sum(const ll &x) { return x * (x + 1) >> 1; }
-
- const int N = 100;
- ll f[N];
-
- int main() {
- OPEN(subsetz);
- ios::sync_with_stdio(false), cin.tie(0);
- int n;
- cin >> n;
- int x = sum(n);
- if(x & 1) {
- cout << 0 << '\n';
- return 0;
- }
- x >>= 1;
- f[0] = 1;
- for(register int i = 1; i<=n; ++i)
- for(register int j = x; j>=i; --j)
- f[j] += f[j-i];
- cout << (f[x] >> 1) << '\n';
- return 0;
- }