GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 13 / 0 / 13
Functions: 100.0% 1 / 0 / 1
Branches: 60.7% 17 / 0 / 28

test/cpv/library-checker-datastructure/unionfind_with_potential.mints-ms64.cpp
Line Branch Exec Source
1 #define AUTO_GENERATED
2 // competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/unionfind_with_potential
3 #include "../../../src/ds/dsu/w/lib.hpp"
4
5 using namespace tifa_libs;
6 CEXP u32 MOD = 998244353;
7
8 #include "../../../src/math/ds/mint/ms64/lib.hpp"
9
10 using namespace tifa_libs;
11 using mint = mint_ms64<MOD>;
12
13 18 int main() {
14
1/2
✓ Branch 2 taken 18 times.
✗ Branch 3 not taken.
18 std::cin.tie(nullptr)->std::ios::sync_with_stdio(false);
15 u32 n, q;
16
2/4
✓ Branch 1 taken 18 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 18 times.
✗ Branch 5 not taken.
18 std::cin >> n >> q;
17 18 tifa_libs::dsu_weighted<mint> dsu(n);
18
2/2
✓ Branch 0 taken 2448339 times.
✓ Branch 1 taken 18 times.
2448357 flt_ (u32, i, 0, q) {
19 u32 op, u, v;
20
3/6
✓ Branch 1 taken 2448339 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2448339 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2448339 times.
✗ Branch 8 not taken.
2448339 std::cin >> op >> u >> v;
21
2/2
✓ Branch 0 taken 956555 times.
✓ Branch 1 taken 1491784 times.
2448339 if (op) {
22
3/4
✓ Branch 1 taken 666505 times.
✓ Branch 2 taken 290050 times.
✓ Branch 4 taken 666505 times.
✗ Branch 5 not taken.
956555 if (!dsu.same(u, v)) std::cout << "-1\n";
23
1/2
✓ Branch 3 taken 290050 times.
✗ Branch 4 not taken.
290050 else std::cout << dsu.diff(u, v) << '\n';
24 } else {
25 i64 k;
26
1/2
✓ Branch 1 taken 1491784 times.
✗ Branch 2 not taken.
1491784 std::cin >> k;
27
2/4
✓ Branch 3 taken 1491784 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1491784 times.
✗ Branch 7 not taken.
1491784 std::cout << dsu.merge(u, v, k) << '\n';
28 }
29 }
30 18 return 0;
31 18 }
32