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

新手郁闷,为什么2323runtimeerror

Posted by ecjtuhcb at 2007-06-02 18:47:27
#include<iostream>
using namespace std;
unsigned __int64 a[20][205];
int main()
{
	int n,k,i,j,b[20],l;
	b[1]=0;b[2]=1;
	a[1][0]=0;a[2][0]=1;a[2][1]=1;a[3][0]=1;a[3][1]=2;a[3][2]=2;a[3][3]=1;
	for(i=2,j=1;i<=200;i++,j++)
		b[i]=b[j]+j;
		for(i=3;i<=18;i++)
		{
			for(j=0;j<=200;j++)
			{
				if(b[i-1]>j)
					l=j;
				else
					l=b[i-1];
				a[i][j]=0;
				while(l>=0)
				{
					if(l+i-1>=j)
					{
						a[i][j]+=a[i-1][l];
						l--;
					}
					else
						break;
				}
			}
}
while(cin>>n>>k&&!(n==0&&k==0))
	printf("%I64u\n",a[n][k]);
return 0;
}
/*
3 0
3 1
3 2
3 3
4 2
4 10
13 23
18 80
*/

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