Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

AC50 留作纪念

Posted by doing100 at 2015-08-18 01:23:12 on Problem 1953
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator