A(n, m)
LL A(LL n, LL m) {
LL w = 1;
for (int i = m; i >= 1; i--) {
w *= n--; //n × n-1 × n-2 × ... n-m,m就是需要减1的次数
}
return w;
}
C(n, m) = C(n, m - 1) + C(n - 1, m - 1)
LL C(LL n, LL m)
{
LL w = 1;
m = min(m, n - m);
for (LL i = 1; i <= m; ++i) {
w = w * (n - m + i) / i;
}
return w;
}