File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
library/data_structures_[l,r)/seg_tree_uncommon Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 2525"tests/library_checker_aizu_tests/data_structures/implicit_seg_tree.test.cpp" : " 2026-01-18 11:15:41 +0000" ,
2626"tests/library_checker_aizu_tests/data_structures/kruskal_tree_aizu.test.cpp" : " 2026-01-18 02:20:40 +0000" ,
2727"tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp" : " 2026-01-18 11:15:41 +0000" ,
28- "tests/library_checker_aizu_tests/data_structures/kth_smallest_wavelet_matrix.test.cpp" : " 2026-01-18 02:20:40 +0000" ,
2928"tests/library_checker_aizu_tests/data_structures/lazy_segment_tree.test.cpp" : " 2026-01-18 04:18:37 -0700" ,
3029"tests/library_checker_aizu_tests/data_structures/lazy_segment_tree_constructor.test.cpp" : " 2026-01-18 04:18:37 -0700" ,
3130"tests/library_checker_aizu_tests/data_structures/lazy_segment_tree_inc.test.cpp" : " 2026-01-18 11:04:58 +0000" ,
7574"tests/library_checker_aizu_tests/handmade_tests/functional_graph.test.cpp" : " 2025-08-06 16:18:37 -0600" ,
7675"tests/library_checker_aizu_tests/handmade_tests/hilbert_mos.test.cpp" : " 2026-01-18 02:20:40 +0000" ,
7776"tests/library_checker_aizu_tests/handmade_tests/manacher.test.cpp" : " 2026-01-18 11:15:41 +0000" ,
78- "tests/library_checker_aizu_tests/handmade_tests/merge_st_and_wavelet.test.cpp" : " 2026-01-18 11:04:58 +0000" ,
7977"tests/library_checker_aizu_tests/handmade_tests/mobius.test.cpp" : " 2025-02-10 14:50:36 -0700" ,
8078"tests/library_checker_aizu_tests/handmade_tests/mod_division.test.cpp" : " 2025-09-07 16:12:35 -0600" ,
8179"tests/library_checker_aizu_tests/handmade_tests/n_choose_k.test.cpp" : " 2025-08-28 13:19:16 -0600" ,
Original file line number Diff line number Diff line change 1111struct wavelet_matrix {
1212 int n;
1313 vector<bit_vec> bv;
14+ <<<<<<< HEAD
1415 wavelet_matrix (vector<ll> a, int lg):
1516 n (sz(a)), bv(lg, {{}}) {
1617 for (int h = sz (bv); h--;) {
1718 vector<bool > b (n);
1819 rep (i, 0 , n) b[i] = (~a[i] >> h) & 1 ;
20+ =======
21+ wavelet_matrix (const vector<ull>& a, ull max_val):
22+ n (sz (a)), bv (bit_width (max_val), {{}}) {
23+ vi idx (n);
24+ iota (all (idx), 0 );
25+ for (int h = sz (bv); h--;) {
26+ vector<bool > b (n);
27+ rep (i, 0 , n) b[i] = (~a[idx[i]] >> h) & 1 ;
28+ ranges::stable_partition (idx,
29+ [&](int i) { return b[i]; });
30+ >>>>>>> d33c8d6ad7b529d498b855449a3b9d57f04e402c
1931 bv[h] = b;
2032 ranges::stable_partition (a,
2133 [&](ll x) { return (~x >> h) & 1 ; });
You can’t perform that action at this time.
0 commit comments