提交时间:2023-10-05 23:30:07
运行 ID: 105282
#include<bits/stdc++.h> using namespace std; int sum = 0,x[1005]; int dfs(int n){ if (x[n]){ return x[n]; } x[n] = 1; for (int i = 1;i <= n / 2;i++){ if (!x[i]){ x[i] = dfs(i); } x[n] += x[i]; } return x[n]; } int main(){ int n; cin>>n; cout<<dfs(n); return 0; }