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 trueshlqsh at 2008-06-24 20:59:56 on Problem 1942
想了半天,觉得会超范围,递归会爆,没有写……
借用了gemenhao的程序:
#include<iostream.h>
typedef long long l64;
l64 Cnm(l64 n,l64 m)
{		  
	 return m>0?(Cnm(n-1,m-1)*n)/m:1;
}
 int main()
{			 
	 l64 m,n;
	 while(cin>>n>>m&&m+n>0)
		 cout<<Cnm(m+n,(m<n)?m:n)<<endl;
	 return 0;	
} 

----------------
明显是递归做的,输入一个7位数,就崩了。。
问题是题目描述说的是32位无符号整数……狂汗中……怎么AC的啊。。。强烈BS题目数据……

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