GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 11 / 0 / 11
Functions: 100.0% 1 / 0 / 1
Branches: 60.0% 12 / 0 / 20

test/cpv/library-checker-datastructure/unionfind.cpp
Line Branch Exec Source
1 // competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/unionfind
2 #include "../../../src/ds/dsu/basic/lib.hpp"
3
4 using namespace tifa_libs;
5 18 int main() {
6
1/2
✓ Branch 2 taken 18 times.
✗ Branch 3 not taken.
18 std::cin.tie(nullptr)->std::ios::sync_with_stdio(false);
7 u32 n, q;
8
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;
9 18 dsu_basic dsu(n + 1);
10
2/2
✓ Branch 0 taken 2448336 times.
✓ Branch 1 taken 18 times.
2448354 flt_ (u32, i, 1, q + 1) {
11 u32 t, u, v;
12
3/6
✓ Branch 1 taken 2448336 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2448336 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2448336 times.
✗ Branch 8 not taken.
2448336 std::cin >> t >> u >> v;
13
2/2
✓ Branch 0 taken 1491371 times.
✓ Branch 1 taken 956965 times.
2448336 if (t == 0)
14 1491371 dsu.merge(u, v);
15 else
16
2/4
✓ Branch 2 taken 956965 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 956965 times.
✗ Branch 6 not taken.
956965 std::cout << dsu.same(u, v) << '\n';
17 }
18 18 return 0;
19 18 }
20