#include <iostream>
#include <string>
#include <queue>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#define maxn 55
using namespace std;
int n;
long long dp[maxn];
int main()
{
//freopen("data.in","r",stdin);
ios::sync_with_stdio(false);
cin >> n;
dp[1] = 3;
dp[2] = 6;
dp[3] = 6;
for(int i = 4; i <= n; ++i) {
dp[i] = dp[i-1] + 2 * dp[i-2];
}
cout << dp[n] << endl;
return 0;
}
计蒜客 墙壁涂色(DP)
最新推荐文章于 2021-01-10 11:06:35 发布