标签:
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 12149 Accepted Submission(s):
5517
#include<stdio.h> #include<string.h> //#define LL long long #define MAX 35 __int64 high[MAX],low[MAX]; int n; int main() { int i,j; low[0]=0; high[0]=1; for(i=1;i<MAX;i++) { high[i]=high[i-1]*3+low[i-1]*2; low[i]=low[i-1]+high[i-1]; } while(scanf("%d",&n)&&n!=-1) { printf("%I64d, %I64d\n",high[n],low[n]); } return 0; }
标签:
原文地址:http://www.cnblogs.com/tonghao/p/4717564.html