test/cpv/library-checker-polynomial/inv_of_polynomials.mints-ms.mints-ms.poly_anymod-p3ntt.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #define AUTO_GENERATED | ||
| 2 | // competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/inv_of_polynomials | ||
| 3 | #include "../../../src/fps/modinv/lib.hpp" | ||
| 4 | #include "../../../src/io/fastin/lib.hpp" | ||
| 5 | #include "../../../src/io/fastout/lib.hpp" | ||
| 6 | |||
| 7 | using namespace tifa_libs; | ||
| 8 | CEXP u32 MOD = 998244353; | ||
| 9 | |||
| 10 | #include "../../../src/fps/ds/ntt3/lib.hpp" | ||
| 11 | #include "../../../src/math/ds/mint/ms/lib.hpp" | ||
| 12 | |||
| 13 | using namespace tifa_libs; | ||
| 14 | using mint = mint_ms<MOD>; | ||
| 15 | using namespace tifa_libs; | ||
| 16 | using mint_p3ntt1 = mint_ms<167772161>; | ||
| 17 | using mint_p3ntt2 = mint_ms<469762049>; | ||
| 18 | using mint_p3ntt3 = mint_ms<754974721>; | ||
| 19 | using poly = poly3ntt<mint, mint_p3ntt1, mint_p3ntt2, mint_p3ntt3>; | ||
| 20 | |||
| 21 | 18 | int main() { | |
| 22 | u32 n, m; | ||
| 23 | 18 | tifa_libs::fin_uint >> n >> m; | |
| 24 | 18 | poly a(n), b(m); | |
| 25 | 18 | tifa_libs::fin_uint >> a >> b; | |
| 26 | 18 | auto _ = tifa_libs::modinv_fps(a, b); | |
| 27 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 2 taken 17 times.
|
18 | if (!_) tifa_libs::fout << "-1\n"; |
| 28 |
2/2✓ Branch 2 taken 1 time.
✓ Branch 3 taken 16 times.
|
17 | else if (_->is_zero()) tifa_libs::fout << "0\n"; |
| 29 | 16 | else tifa_libs::fout << _->size() << '\n' | |
| 30 |
1/2✓ Branch 2 taken 16 times.
✗ Branch 3 not taken.
|
16 | << _.value() << '\n'; |
| 31 | 18 | return 0; | |
| 32 | 18 | } | |
| 33 |