0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-10 02:58:48 +00:00

「MCOI-09」MCOI Round 9

T182489: R52546756
This commit is contained in:
Baoshuo Ren 2021-07-07 15:34:06 +08:00 committed by Baoshuo Ren
parent 6899c72512
commit 3ebdb99d95
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

View File

@ -0,0 +1,29 @@
#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int main() {
int n, k;
cin >> n >> k;
int v = 1, q = 1;
for (int i = 0; i < n - k; i++) {
v = 2ll * v % mod;
}
for (int i = n - k + 1; i <= n; i++) {
v = 1ll * i * v % mod;
}
for (int i = 1; i <= k; i++) {
q = 1ll * i * q % mod;
}
int a = 1, e = mod - 2;
while (e) {
if (e & 1) {
a = 1ll * a * q % mod;
}
q = 1ll * q * q % mod;
e >>= 1;
}
cout << 1ll * v * a % mod << endl;
}