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

为什么wa呀??

Posted by hdjtdxacm at 2008-12-26 18:00:07 on Problem 1306
#include<stdio.h>
__int64 a[105];
int main()
{
	__int64 i,n,m,c;
	while(scanf("%I64d%I64d",&n,&m)&&n!=0)
	{
		c=m;
		if(m>n/2)
			m=n-m;
		a[1]=n;
		if(n==1)
		{printf("%I64d things taken %I64d at a time is 1 exactly.\n",n,c);}
		else
		{
		for(i=2;i<=m;i++)
			a[i]=(n-i+1)*a[i-1]/i;
		printf("%I64d things taken %I64d at a time is %I64d exactly.\n",n,c,a[m]);
		}
	}
	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