1 条题解
-
0
简单的二项式定理应用
#include <bits/stdc++.h> using namespace std; int a, b, k, n, m; int c[1005][1005]; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> a >> b >> k >> n >> m; a %= 10007; b %= 10007; for (int i = 1; i <= k + 1; i++) for (int j = 1; j <= i; j++) if (j == 1 || j == i) c[i][j] = 1; else c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % 10007; int ans = 1; for (int i = 1; i <= n; i++) ans = (ans * a) % 10007; for (int i = 1; i <= m; i++) ans = (ans * b) % 10007; cout << (ans * c[k + 1][n + 1]) % 10007 << endl; return 0; }
- 1
信息
- ID
- 121
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 5
- 标签
- 递交数
- 25
- 已通过
- 14
- 上传者