Skip to content

Commit 078f509

Browse files
committed
fix
1 parent 693ec76 commit 078f509

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22
//! count of i in [l..r) such that a[i] < ub
3-
//! @time O(log(max_val))
3+
//! @time O(lg)
44
//! @space O(1)
55
int count(int l, int r, ll ub) {
66
int res = 0;

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,10 @@
1111
struct wavelet_matrix {
1212
int n;
1313
vector<bit_vec> bv;
14-
<<<<<<< HEAD
15-
wavelet_matrix(vector<ll> a, int lg):
16-
n(sz(a)), bv(lg, {{}}) {
14+
wavelet_matrix(vector<ll> a, int lg): n(sz(a)), bv(lg, {{}}) {
1715
for (int h = sz(bv); h--;) {
1816
vector<bool> b(n);
1917
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
3118
bv[h] = b;
3219
ranges::stable_partition(a,
3320
[&](ll x) { return (~x >> h) & 1; });

0 commit comments

Comments
 (0)