nyoj-158-省赛来了(组合数)

时间:2023-03-10 03:07:41
nyoj-158-省赛来了(组合数)

题目链接

 /*
Name:nyoj-158-省赛来了
Copyright:
Author:
Date: 2018/4/25 17:07:22
Description:
暴力,秒天秒地
*/
#include <iostream>
#include <cstdio>
using namespace std;
long long c[][];
int main()
{
for (int i=; i<; i++) {
c[i][] = c[i][i] = ;
for (int j=; j<i; j++) {
c[i][j] = c[i-][j] + c[i-][j-];
}
}
int m, n;
while (cin>>m>>n) {
long long ans = ;
while (m > ) {
ans *= c[m][n];
m -= n;
}
cout <<ans %<<endl;
}
return ;
}