首页 > 其他 > 详细

12 day 1

时间:2014-10-20 16:40:19      阅读:237      评论:0      收藏:0      [点我收藏+]
#include <cstdio>
int i,j,m,n,t;
long long f[6000][6000];
inline int min(int a,int b){
	return a<b?a:b;
}
int main(){
//	freopen("ticket.in","r",stdin);
//	freopen("ticket.out","w",stdout);
	scanf("%d%d",&n,&m);
	for(i=1;i<=n;++i) f[i][0]=1;
	for(i=1;i<=n;++i){
		t=min(m,i);
		for(j=1;j<=t;++j){
			if(i==j){
				f[i][j]=f[i][j-1];
			}else{
				f[i][j]=f[i][j-1]+f[i-1][j];
			}
		}
	}
	printf("%lld\n",f[n][m]);
	return 0;
}

恩简单的代码。。。没有高精度会爆精度。。再修改+推导吧。

12 day 1

原文:http://www.cnblogs.com/tmzbot/p/4037355.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!