Skip to content

Commit 693ec76

Browse files
committed
Merge branch 'another-try' of github.com:programming-team-code/programming_team_code into another-try
2 parents 813033a + d33c8d6 commit 693ec76

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.verify-helper/timestamps.remote.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
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",
@@ -75,7 +74,6 @@
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",

library/data_structures_[l,r)/seg_tree_uncommon/wavelet_matrix.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,23 @@
1111
struct 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; });

0 commit comments

Comments
 (0)