Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
对这个题目无语了……想了半天,觉得会超范围,递归会爆,没有写…… 借用了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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator