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: 58.3% 14 / 0 / 24

test/cpv/library-checker-datastructure/associative_array.hash-chash.hashmap-pbds_gp_hmap.cpp
Line Branch Exec Source
1 #define AUTO_GENERATED
2 // competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/associative_array
3 #include "../../../src/util/alias/others/lib.hpp"
4 //
5
6 using namespace tifa_libs;
7 template <class T>
8 using hashfunc_t = chash<T>;
9 using namespace tifa_libs;
10 template <class K, class V>
11 using hashmap = __gnu_pbds::gp_hash_table<K, V, std::conditional_t<std::is_void_v<hashfunc_t<K>>, TPN __gnu_pbds::detail::default_hash_fn<K>::type, hashfunc_t<K>>>;
12
13 20 int main() {
14
1/2
✓ Branch 2 taken 20 times.
✗ Branch 3 not taken.
20 std::cin.tie(nullptr)->std::ios::sync_with_stdio(false);
15 u64 q;
16
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
20 std::cin >> q;
17
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
20 hashmap<u64, u64> hm;
18
2/2
✓ Branch 0 taken 15673163 times.
✓ Branch 1 taken 20 times.
15673183 for (u64 i = 0, op, k, v; i < q; ++i) {
19
2/4
✓ Branch 1 taken 15673163 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 15673163 times.
✗ Branch 5 not taken.
15673163 std::cin >> op >> k;
20
5/8
✓ Branch 0 taken 7647884 times.
✓ Branch 1 taken 8025279 times.
✓ Branch 3 taken 7647884 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 7647884 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 7647884 times.
✗ Branch 10 not taken.
15673163 if (op) std::cout << hm[k] << '\n';
21 else {
22
1/2
✓ Branch 1 taken 8025279 times.
✗ Branch 2 not taken.
8025279 std::cin >> v;
23
1/2
✓ Branch 1 taken 8025279 times.
✗ Branch 2 not taken.
8025279 hm[k] = v;
24 }
25 }
26 20 return 0;
27 20 }
28