组合数
static long C(int a,int b) {
//if(a==0&&b==0) return 1;
long res=1;
for(long i=a,j=1;j<=b;i--,j++) {
res=res*i/j;
if(res>n) return res; //防止爆ll
}
return res;
}
static long C(int a,int b) {
//if(a==0&&b==0) return 1;
long res=1;
for(long i=a,j=1;j<=b;i--,j++) {
res=res*i/j;
if(res>n) return res; //防止爆ll
}
return res;
}
相关推荐