标签:blog io for div on log 代码 amp line
#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; }
恩简单的代码。。。没有高精度会爆精度。。再修改+推导吧。
标签:blog io for div on log 代码 amp line
原文地址:http://www.cnblogs.com/tmzbot/p/4037355.html