题目 :Problem - 2190 (hdu.edu.cn)
#include<bits/stdc++.h>
using namespace std;
#define MXN 40
typedef long long ll;
ll ans[MXN];
int main(){int c,n;ans[1]=1;ans[2]=3;for(int i=3;i<=MXN;i++){ans[i]=ans[i-1]+ans[i-2]*2;}scanf("%d",&c);while(c--){scanf("%d",&n);printf("%lld\n",ans[n]); }return 0;
}