We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 040cc2d commit 2293172Copy full SHA for 2293172
library/data_structures/bit_uncommon/next.hpp
library/data_structures/bit_uncommon/prev.hpp
tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp
@@ -49,12 +49,12 @@ int main() {
49
cout << bit.query(x) << '\n';
50
} else if (type == 4) {
51
x = get_compressed_idx(x);
52
- int res = bit.prev(x);
+ int res = bit.walk(bit.query(x));
53
if (res == -1) cout << -1 << '\n';
54
else cout << compress[res] << '\n';
55
} else {
56
57
- int res = bit.next(x);
+ int res = bit.walk(bit.query(x - 1)) + 1;
58
if (res == ssize(bit.s)) cout << -1 << '\n';
59
60
}
0 commit comments