1 条题解
-
1
C++ :
#include <bits/stdc++.h> using namespace std; int inv[100010]; int C(int n, int m) { int ans = 1; inv[1] = 1; for (int i = 2; i <= m; i++) inv[i] = ((10007 - 10007 / i) * inv[10007 % i]) % 10007, ans = (ans * inv[i]) % 10007; for (int i = n; i > n - m; i--) ans = (ans * i) % 10007; return ans; } int pow(int a, int b) { a %= 10007; int res = 1; while (b) { if (b & 1) res = (res * a) % 10007; a = (a * a) % 10007, b >>= 1; } return res; } int main() { int a, b, k, n, m; cin >> a >> b >> k >> n >> m; cout << ((pow(a, n) * pow(b, m)) % 10007 * C(k, n)) % 10007; return 0; }
信息
- ID
- 2842
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者