阿牛的EOF牛肉串

 

#include <cstdio>

long long int memo[50];

long long int f(long long int n)
{
	memo[1] = 3;
	memo[2] = 8;
	
	for(long long int i = 3; i <= n; ++ i)
	{
		memo[i] = 2 * memo[i - 1] + 2 * memo[i - 2];
	}
	
	return memo[n];
}

int main()
{
	int n;
	while(scanf("%d", &n) != EOF)
	{
		printf("%lld\n", f(n));
	}
	
	return 0;
}

  

posted @ 2019-08-02 17:12  青衫客36  阅读(140)  评论(0编辑  收藏  举报