Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
AC50 留作纪念#include<stdio.h> long long int dp[46][2]; int main() { int N,i,k; scanf("%d",&N); dp[1][0]=1; dp[1][1]=1; for(i=2;i<=45;i++){ dp[i][1]=dp[i-1][0]; dp[i][0]=dp[i-1][0]+dp[i-1][1]; } for(i=1;i<=N;i++) { scanf("%d",&k); printf("Scenario #%d:\n",i); printf("%lld\n\n",dp[k][1]+dp[k][0]); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator