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

Why OLE跪求

Posted by wangfengtian at 2009-04-03 18:45:15 on Problem 1942 and last updated at 2009-04-12 16:25:29
#include<iostream>
using namespace std;
int main()
{
	int m,n,d,i,j,t,h;
	__int64 an;
	while(1)
	{
		cin>>m>>n;
		if(m==0&&n==0)
			break;
		d=m+n;
		t=h=m<n?m:n;
		an=1;
		for(i=0;i<t;i++)
		{
			an=an*(d-i);
			if(h>0&&an%h==0)
			{
				an=an/h;
				h--;
			}
		}
		printf("%I64d\n",an);

	}
}

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