记录编号 569237 评测结果 AAAAAAA
题目名称 集合平分 最终得分 100
用户昵称 Gravatarlihaoze 是否通过 通过
代码语言 C++ 运行时间 0.000 s
提交时间 2022-02-25 21:05:36 内存使用 0.00 MiB
显示代码纯文本
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <cstring>
  4. #define OPEN(_x) freopen(#_x".in", "r", stdin); freopen(#_x".out", "w", stdout)
  5.  
  6. using namespace std;
  7.  
  8. typedef long long ll;
  9.  
  10. inline ll sum(const ll &x) { return x * (x + 1) >> 1; }
  11.  
  12. const int N = 100;
  13. ll f[N];
  14.  
  15. int main() {
  16. OPEN(subsetz);
  17. ios::sync_with_stdio(false), cin.tie(0);
  18. int n;
  19. cin >> n;
  20. int x = sum(n);
  21. if(x & 1) {
  22. cout << 0 << '\n';
  23. return 0;
  24. }
  25. x >>= 1;
  26. f[0] = 1;
  27. for(register int i = 1; i<=n; ++i)
  28. for(register int j = x; j>=i; --j)
  29. f[j] += f[j-i];
  30. cout << (f[x] >> 1) << '\n';
  31. return 0;
  32. }