标签:des style blog http java color
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2888 Accepted Submission(s): 1588
#include <iostream> #include <stdio.h> #include <string.h> #include <algorithm> #include <math.h> using namespace std; #define N 505 #define INF 0x3f3f3f3f #define LL long long int dp[50]; int main() { int i,n,c; dp[1] = 1,dp[2] = 3 ,dp[3] = 7; for(i = 4; i <=40; i++) dp[i] = 2*dp[i-1]+dp[i-2]; scanf("%d",&c); while(c--) { scanf("%d",&n); printf("%d\n",3*dp[n]); } return 0; }
标签:des style blog http java color
原文地址:http://www.cnblogs.com/llei1573/p/3848223.html