提交时间:2023-10-08 13:30:36

运行 ID: 105821

#include<bits/stdc++.h> using namespace std; int a[10001]; int main() { int n; cin>>n; a[1]=1; a[2]=2; for(int i=3;i<=n;i++) if(i%2==0) a[i]=a[i-1]+a[i/2]; else a[i]=a[i-1]; cout<<a[n]<<endl; }