排列组合 长的那边Ank 短的那边Cmk
#include <bits/stdc++.h> using namespace std; int a[11]; int main() { ios::sync_with_stdio(false); a[0] = 1; for (int i = 1; i < 11; i++) { a[i] = i * a[i - 1]; } int n, m, k; long long ans = 1; while (cin >> n >> m >> k) { int mid; if (m > n) { mid = m; m = n; n = mid; } ans = a[n] / a[n-k] * (a[m] / (a[m - k] * a[k])); printf("%lld\n", ans); } }
暴搜+打表的飘过,,, [em:07][em:07]
排列组合
长的那边Ank
短的那边Cmk
暴搜+打表的飘过,,,
[em:07][em:07]