mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 18:48:48 +00:00
#13368. 「NOIP2022模拟赛pb」丝线
http://www.nfls.com.cn:10611/submission/244428
This commit is contained in:
parent
bce62b97bb
commit
1ef8dcd945
38
NFLSOJ/13368/13368.cpp
Normal file
38
NFLSOJ/13368/13368.cpp
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
// using std::cin;
|
||||||
|
// using std::cout;
|
||||||
|
std::ifstream cin("string.in");
|
||||||
|
std::ofstream cout("string.out");
|
||||||
|
const char endl = '\n';
|
||||||
|
|
||||||
|
const int N = 1e6 + 5;
|
||||||
|
const int mod = 998244353;
|
||||||
|
|
||||||
|
int a, b, inv[N << 2], ans;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
std::ios::sync_with_stdio(false);
|
||||||
|
cin.tie(nullptr);
|
||||||
|
|
||||||
|
cin >> a >> b;
|
||||||
|
|
||||||
|
inv[0] = inv[1] = 1;
|
||||||
|
|
||||||
|
for (int i = 2; i <= a + a + b; i++) {
|
||||||
|
inv[i] = static_cast<long long>(mod - mod / i) * inv[mod % i] % mod;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 1; i <= a; i++) {
|
||||||
|
ans = (static_cast<long long>(ans) + inv[2 * i - 1]) % mod;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 1; i <= b; i++) {
|
||||||
|
ans = (static_cast<long long>(ans) + inv[2 * a + i]) % mod;
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << ans << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
NFLSOJ/13368/samples/ex_string1.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13368/samples/ex_string1.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13368/samples/ex_string1.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13368/samples/ex_string1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13368/samples/ex_string2.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13368/samples/ex_string2.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13368/samples/ex_string2.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13368/samples/ex_string2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13368/samples/ex_string3.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13368/samples/ex_string3.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13368/samples/ex_string3.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13368/samples/ex_string3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13368/samples/ex_string4.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13368/samples/ex_string4.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13368/samples/ex_string4.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13368/samples/ex_string4.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13368/string.pdf
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13368/string.pdf
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user