提交时间:2023-10-04 09:05:48

运行 ID: 104753

#include<bits/stdc++.h> using namespace std; #define int long long int a[1005]; signed main(){ int n; cin>>n; a[1]=3; a[2]=7; for(int i=3;i<=n;i++)a[i]=a[i-1]*2+a[i-2]; cout<<a[n]; return 0; }