test/cpv/library-checker-datastructure/static_range_frequency.hash-splitmix64.hashmap-pbds_cc_hmap.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #define AUTO_GENERATED | ||
| 2 | // competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/static_range_frequency | ||
| 3 | #include "../../../src/util/alias/others/lib.hpp" | ||
| 4 | // | ||
| 5 | #include "../../../src/edh/splitmix64/lib.hpp" | ||
| 6 | |||
| 7 | using namespace tifa_libs; | ||
| 8 | template <class> | ||
| 9 | using hashfunc_t = hash_splitmix64; | ||
| 10 | using namespace tifa_libs; | ||
| 11 | template <class K, class V> | ||
| 12 | using hashmap = __gnu_pbds::cc_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>>>; | ||
| 13 | |||
| 14 | 11 | int main() { | |
| 15 |
1/2✓ Branch 2 taken 11 times.
✗ Branch 3 not taken.
|
11 | std::cin.tie(nullptr)->std::ios::sync_with_stdio(false); |
| 16 | u32 n, q; | ||
| 17 |
2/4✓ Branch 1 taken 11 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 11 times.
✗ Branch 5 not taken.
|
11 | std::cin >> n >> q; |
| 18 |
1/2✓ Branch 1 taken 11 times.
✗ Branch 2 not taken.
|
11 | vecu a(n); |
| 19 |
3/4✓ Branch 4 taken 2906500 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 2906500 times.
✓ Branch 9 taken 11 times.
|
2906511 | for (auto& i : a) std::cin >> i; |
| 20 |
1/2✓ Branch 1 taken 11 times.
✗ Branch 2 not taken.
|
11 | hashmap<u32, vecu> hm; |
| 21 |
4/6✓ Branch 2 taken 2906500 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 2906500 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 2906500 times.
✓ Branch 8 taken 11 times.
|
2906511 | flt_ (u32, i, 0, n) hm[a[i]].push_back(i); |
| 22 |
2/2✓ Branch 0 taken 4206477 times.
✓ Branch 1 taken 11 times.
|
4206488 | flt_ (u32, i, 1, q + 1, l, r, x) { |
| 23 |
3/6✓ Branch 1 taken 4206477 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4206477 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4206477 times.
✗ Branch 8 not taken.
|
4206477 | std::cin >> l >> r >> x; |
| 24 |
2/2✓ Branch 0 taken 1083508 times.
✓ Branch 1 taken 3122969 times.
|
4206477 | if (l == r) { |
| 25 |
1/2✓ Branch 1 taken 1083508 times.
✗ Branch 2 not taken.
|
1083508 | std::cout << "0\n"; |
| 26 | 1083508 | continue; | |
| 27 | } | ||
| 28 |
1/2✓ Branch 1 taken 3122969 times.
✗ Branch 2 not taken.
|
3122969 | auto CR now = hm[x]; |
| 29 |
2/4✓ Branch 1 taken 3122969 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3122969 times.
✗ Branch 5 not taken.
|
3122969 | auto it1 = std::ranges::lower_bound(now, l), it2 = std::ranges::upper_bound(now, r - 1); |
| 30 |
2/4✓ Branch 2 taken 3122969 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 3122969 times.
✗ Branch 6 not taken.
|
3122969 | std::cout << it2 - it1 << '\n'; |
| 31 | } | ||
| 32 | 11 | return 0; | |
| 33 | 11 | } | |
| 34 |