test/cpv/library-checker-number_theory/sum_of_totient_function.du-ls.mints-ms64.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #define AUTO_GENERATED | ||
| 2 | // competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/sum_of_totient_function | ||
| 3 | #include "../../../src/math/iroot/sqrt/lib.hpp" | ||
| 4 | #include "../../../src/nt/lsieve/func/lib.hpp" | ||
| 5 | #include "../../../src/nt/lsieve/impl1/lib.hpp" | ||
| 6 | #include "../../../src/nt/mfsum/du/lib.hpp" | ||
| 7 | |||
| 8 | using namespace tifa_libs; | ||
| 9 | CEXP u32 MOD = 998244353; | ||
| 10 | |||
| 11 | #include "../../../src/math/ds/mint/ms64/lib.hpp" | ||
| 12 | |||
| 13 | using namespace tifa_libs; | ||
| 14 | using mint = mint_ms64<MOD>; | ||
| 15 | |||
| 16 | 48 | int main() { | |
| 17 |
1/2✓ Branch 2 taken 48 times.
✗ Branch 3 not taken.
|
48 | std::cin.tie(nullptr)->std::ios::sync_with_stdio(false); |
| 18 | u64 n; | ||
| 19 |
1/2✓ Branch 1 taken 48 times.
✗ Branch 2 not taken.
|
48 | std::cin >> n; |
| 20 | 48 | vec<mint> sphi; | |
| 21 | { | ||
| 22 | 48 | auto _ = tifa_libs::lsieve<tifa_libs::ls_phi>(tifa_libs::isqrt(n)).phi; | |
| 23 |
1/2✓ Branch 2 taken 48 times.
✗ Branch 3 not taken.
|
48 | sphi.reserve(_.size()); |
| 24 |
3/4✓ Branch 5 taken 3084589 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 3084589 times.
✓ Branch 10 taken 48 times.
|
3084637 | for (auto i : _) sphi.push_back(i); |
| 25 |
1/2✓ Branch 4 taken 48 times.
✗ Branch 5 not taken.
|
48 | std::inclusive_scan(begin(sphi), end(sphi), begin(sphi)); |
| 26 | 48 | } | |
| 27 |
1/2✓ Branch 1 taken 48 times.
✗ Branch 2 not taken.
|
3477548464 | auto sf = [sphi](u64 x) -> mint { return sphi[x]; }; |
| 28 | 7022637839 | auto sg = [](u64 x) -> mint { return x; }; | |
| 29 | 3084619 | auto sh = [](u64 x) -> mint { return mint{x} * (x + 1) * ((mint::mod() + 1) / 2); }; | |
| 30 |
2/4✓ Branch 1 taken 48 times.
✗ Branch 2 not taken.
✓ Branch 8 taken 48 times.
✗ Branch 9 not taken.
|
48 | std::cout << tifa_libs::du_sieve<mint, decltype(sf), decltype(sg), decltype(sh)>(sphi.size() - 1, sf, sg, sh)(n) << '\n'; |
| 31 | 48 | return 0; | |
| 32 | 48 | } | |
| 33 |