mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
P1358 扑克牌
R40056462
This commit is contained in:
parent
3384d136de
commit
8188ec2996
28
problem/P1358/P1358.cpp
Normal file
28
problem/P1358/P1358.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
long long n, m, t, f[10005][105], ans = 1;
|
||||
|
||||
int main() {
|
||||
cin >> n >> m;
|
||||
for (int i = 0; i <= n; i++) {
|
||||
f[i][0] = 1;
|
||||
}
|
||||
for (int i = 1; i <= min(n, m); i++) {
|
||||
f[i][i] = 1;
|
||||
}
|
||||
for (int i = 1; i <= 10000; i++) {
|
||||
for (int j = 0; j <= 100; j++) {
|
||||
f[i][j] = (f[i - 1][j - 1] + f[i - 1][j]) % 10007;
|
||||
}
|
||||
}
|
||||
for (int i = 1; i <= m; i++) {
|
||||
cin >> t;
|
||||
ans *= f[n][t];
|
||||
ans %= 10007;
|
||||
n -= t;
|
||||
}
|
||||
cout << ans << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user