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

求助啊

Posted by suhang at 2009-12-14 19:02:19 on Problem 2229
#include <cstdio>

const int maxn=1000010;

int n;
long long f[maxn];

int main()
{
	
	scanf("%d",&n);
	f[1]=1;
	f[2]=2;
	for (int i=3;i<=n;i++)
	if ( i % 2==1) f[i]=f[i-1];
	else 
    {
         f[i]=(f[i-1]+f[i/2]) ;
//         f[i]=f[i] % 1000000000;
//         f[i]=f[i] / 10;
    }
    f[n]=f[n] % 1000000000;
	printf("%I64d\n",f[n]);
	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