0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-09-08 02:45:26 +00:00

#13368. 「NOIP2022模拟赛pb」丝线

http://www.nfls.com.cn:10611/submission/244428
This commit is contained in:
Baoshuo Ren 2022-11-23 21:18:12 +08:00
parent bce62b97bb
commit 1ef8dcd945
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
10 changed files with 65 additions and 0 deletions

38
NFLSOJ/13368/13368.cpp Normal file
View 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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.