提交时间:2023-10-04 09:45:32

运行 ID: 104807

#include<bits/stdc++.h> using namespace std; #define int unsigned long long int a[1010],n; signed main() { a[1]=1, a[2]=a[3]=2, a[4]=a[5]=4; cin>>n; for(int i=6;i<=n;++i) (!(i%2))?a[i]=a[i-1]+a[i-3]:a[i]=a[i-1]; cout<<a[n]; return 0; }