GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 16 / 0 / 16
Functions: 100.0% 5 / 0 / 5
Branches: 57.1% 8 / 0 / 14

test/cpv/library-checker-number_theory/sum_of_totient_function.du-ls2.mints-ms.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/impl2/lib.hpp"
5 #include "../../../src/nt/mfsum/du/lib.hpp"
6
7 using namespace tifa_libs;
8 CEXP u32 MOD = 998244353;
9
10 #include "../../../src/math/ds/mint/ms/lib.hpp"
11
12 using namespace tifa_libs;
13 using mint = mint_ms<MOD>;
14
15 48 int main() {
16
1/2
✓ Branch 2 taken 48 times.
✗ Branch 3 not taken.
48 std::cin.tie(nullptr)->std::ios::sync_with_stdio(false);
17 u64 n;
18
1/2
✓ Branch 1 taken 48 times.
✗ Branch 2 not taken.
48 std::cin >> n;
19 48 vec<mint> sphi;
20 {
21 48 mint lst = 1;
22 96 sphi = tifa_libs::lsieve2(tifa_libs::isqrt(n)).template run<mint>([&lst](u32 p, u32 e) {
23
2/2
✓ Branch 0 taken 302368 times.
✓ Branch 1 taken 3935 times.
306303 if (e == 1) return lst = p - 1;
24 3935 else return lst = lst * p;
25 48 });
26
1/2
✓ Branch 4 taken 48 times.
✗ Branch 5 not taken.
48 std::inclusive_scan(begin(sphi), end(sphi), begin(sphi));
27 }
28
1/2
✓ Branch 1 taken 48 times.
✗ Branch 2 not taken.
3477527402 auto sf = [sphi](u64 x) -> mint { return sphi[x]; };
29 7022594001 auto sg = [](u64 x) -> mint { return x; };
30 3084571 auto sh = [](u64 x) -> mint { return mint{x} * (x + 1) * ((mint::mod() + 1) / 2); };
31
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';
32 48 return 0;
33 48 }
34