test/cpv/library-checker-datastructure/range_kth_smallest.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/range_kth_smallest | ||
| 2 | #include "../../../src/ds/segtree/persistent/lib.hpp" | ||
| 3 | #include "../../../src/edh/discretization/lib.hpp" | ||
| 4 | #include "../../../src/io/fastin/lib.hpp" | ||
| 5 | #include "../../../src/io/fastout/lib.hpp" | ||
| 6 | |||
| 7 | using namespace tifa_libs; | ||
| 8 | 24 | int main() { | |
| 9 | u32 n, q; | ||
| 10 | 24 | fin_uint >> n >> q; | |
| 11 |
1/2✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
|
24 | veci _(n); |
| 12 |
2/2✓ Branch 6 taken 1528840 times.
✓ Branch 7 taken 24 times.
|
1528864 | for (auto& x : _) fin_int >> x; |
| 13 | 24 | auto [b, a] = gen_id(_); | |
| 14 | 24 | persistent_segtree seg(a, (u32)b.size() + 1); | |
| 15 |
2/2✓ Branch 0 taken 1944121 times.
✓ Branch 1 taken 24 times.
|
1944145 | for (u32 i = 0, l, r, k; i < q; ++i) { |
| 16 | 1944121 | fin_uint >> l >> r >> k; | |
| 17 | 1944121 | fout << b[seg.kth_min(l, r - 1, k + 1)] << '\n'; | |
| 18 | } | ||
| 19 | 24 | return 0; | |
| 20 | 24 | } | |
| 21 |