提交时间:2023-10-05 10:25:51

运行 ID: 105100

#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)+1; return 0; }