提交时间:2023-10-05 10:26:16
运行 ID: 105101
#include<iostream> using namespace std; int f[1001]; int shenma(int x) { if(!f[x]) { if(x==1) f[x]=1; else if(x%2) f[x]=shenma(x-1); else f[x]=shenma(x-1)+shenma(x/2); } return f[x]; } int main() { int a; cin>>a; cout<<shenma(a); return 0; }