GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 24 / 0 / 24
Functions: 100.0% 3 / 0 / 3
Branches: 69.2% 18 / 0 / 26

test/cpv/library-checker-graph/counting_spanning_tree_directed.mintd-md.cpp
Line Branch Exec Source
1 #define AUTO_GENERATED
2 // competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/counting_spanning_tree_directed
3 #include "../../../src/fast/rsort32/lib.hpp"
4 #include "../../../src/graph/ds/alist/lib.hpp"
5 #include "../../../src/graph/ds/amat/lib.hpp"
6 #include "../../../src/graph/ds/info/lib.hpp"
7 #include "../../../src/graph/kirchhoff/lib.hpp"
8 #include "../../../src/lalg/mat/ge/lib.hpp"
9
10 using namespace tifa_libs;
11 CEXP u32 MOD = 998244353;
12
13 #include "../../../src/math/ds/mint/md/lib.hpp"
14
15 using namespace tifa_libs;
16 using mint = mint_md<__LINE__>;
17
18 22 int main() {
19 22 mint::set_mod(MOD);
20
1/2
✓ Branch 2 taken 22 times.
✗ Branch 3 not taken.
22 std::cin.tie(nullptr)->std::ios::sync_with_stdio(false);
21 u32 n, m, r;
22
3/6
✓ Branch 1 taken 22 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 22 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 22 times.
✗ Branch 8 not taken.
22 std::cin >> n >> m >> r;
23 22 tifa_libs::alist<void, degin_tag, degout_tag> g(n);
24
2/2
✓ Branch 0 taken 2831193 times.
✓ Branch 1 taken 22 times.
2831215 for (u32 i = 0, u, v; i < m; ++i) {
25
2/4
✓ Branch 1 taken 2831193 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2831193 times.
✗ Branch 5 not taken.
2831193 std::cin >> u >> v;
26 2831193 g.add_arc(u, v);
27 }
28 22 tifa_libs::amat<mint> mat(n);
29
2/2
✓ Branch 0 taken 2220 times.
✓ Branch 1 taken 22 times.
2242 flt_ (u32, id, 0, n) {
30 2220 auto& tos = g[id];
31
2/2
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2214 times.
2220 if (tos.empty()) continue;
32 2214 tifa_libs::sort(tos);
33 2214 u32 cnt = 1, pre = tos[0];
34
2/2
✓ Branch 1 taken 2828979 times.
✓ Branch 2 taken 2214 times.
2831193 flt_ (u32, j, 1, (u32)tos.size())
35
2/2
✓ Branch 2 taken 745051 times.
✓ Branch 3 taken 2083928 times.
2828979 if (tos[j] != pre) {
36 745051 mat.add_arc(id, pre, cnt), pre = tos[j], cnt = 1;
37 2083928 } else ++cnt;
38 2214 mat.add_arc(id, pre, cnt);
39 }
40 1760154 auto is_0 = [](cT_(mint) x) { return x.val() == 0; };
41 19 auto ge = [&](tifa_libs::matrix<mint>& A, bool clear_u) { return tifa_libs::ge_mat<mint, decltype(is_0), true>(A, is_0, clear_u); };
42
2/4
✓ Branch 1 taken 22 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 22 times.
✗ Branch 6 not taken.
22 std::cout << tifa_libs::kirchhoff<true>(mat, r, ge) << '\n';
43 22 return 0;
44 22 }
45