mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 19:48:51 +00:00
parent
de520c15e2
commit
13525c4d0d
49
LibreOJ/10232/10232.cpp
Normal file
49
LibreOJ/10232/10232.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
#include <iostream>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
const int N = 2005;
|
||||
const int mod = 1e5 + 3;
|
||||
|
||||
int a, b, c, d, k, fac[N], inv[N], fac_inv[N], ans;
|
||||
|
||||
inline int C(int n, int m) {
|
||||
return static_cast<long long>(fac[n]) * fac_inv[m] % mod * fac_inv[n - m] % mod;
|
||||
}
|
||||
|
||||
int f(int n, int m, int k) {
|
||||
if (k > n || k > m) return 0;
|
||||
return static_cast<long long>(C(n, k)) * C(m, k) % mod * fac[k] % mod;
|
||||
}
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
fac[0] = 1;
|
||||
for (int i = 1; i < N; i++) {
|
||||
fac[i] = static_cast<long long>(fac[i - 1]) * i % mod;
|
||||
}
|
||||
|
||||
inv[0] = inv[1] = 1;
|
||||
for (int i = 2; i < N; i++) {
|
||||
inv[i] = static_cast<long long>(mod - mod / i) * inv[mod % i] % mod;
|
||||
}
|
||||
|
||||
fac_inv[0] = fac_inv[1] = 1;
|
||||
for (int i = 2; i < N; i++) {
|
||||
fac_inv[i] = static_cast<long long>(fac_inv[i - 1]) * inv[i] % mod;
|
||||
}
|
||||
|
||||
cin >> a >> b >> c >> d >> k;
|
||||
|
||||
for (int i = 0; i <= k; i++) {
|
||||
ans = (ans + static_cast<long long>(f(a, b, i)) * f(a + c - i, d, k - i)) % mod;
|
||||
}
|
||||
|
||||
cout << ans << endl;
|
||||
|
||||
return 0;
|
||||
}
|
BIN
LibreOJ/10232/data/1.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/1.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/1.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/10.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/10.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/10.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/10.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/2.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/2.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/2.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/3.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/3.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/3.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/4.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/4.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/4.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/4.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/5.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/5.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/5.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/5.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/6.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/6.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/6.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/6.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/7.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/7.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/7.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/7.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/8.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/8.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/8.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/8.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/9.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/9.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/9.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/9.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10232/data/place.cpp
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10232/data/place.cpp
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user