Skip to content

Commit 9d93798

Browse files
committed
update docs again
1 parent f42d6cb commit 9d93798

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

library/data_structures_[l,r)/bit.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
#pragma once
2+
//! @code
3+
//! bit.walk([&](int r, ll sum) -> bool {
4+
//! // sum = a[0] + a[1] + ... + a[r - 1]
5+
//! });
6+
//! int r = bit.walk2(sum);
7+
//! // Returns min r s.t. sum of [0,r] >= sum
8+
//! // Returns n if sum of [0,n-1] < sum
9+
//! @endcode
210
//! @time O(n + q log n)
311
//! @space O(n)
412
// NOLINTNEXTLINE(readability-identifier-naming)

library/data_structures_[l,r)/bit_uncommon/walk.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//! Requires sum of [i,i] >= 0
2-
//! Returns min r s.t. sum of [0,r] >= sum
3-
//! Returns n if sum of [0,n-1] < sum
41
int walk2(ll sum) {
52
if (sum <= 0) return -1;
63
int r = 0;

library/data_structures_[l,r)/bit_uncommon/walk_lambda.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
//! @code
2-
//! bit.walk([&](int r, ll sum) -> bool {
3-
//! // sum = a[0] + a[1] + ... + a[r - 1]
4-
//! });
5-
//! @endcode
61
void walk(const auto& f) {
72
ll sum = 0;
83
for (int i = bit_floor(size(s)), r = 0; i; i /= 2)

library/data_structures_[l,r]/bit.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
#pragma once
2+
//! @code
3+
//! bit.walk([&](int r, ll sum) -> bool {
4+
//! // sum = a[0] + a[1] + ... + a[r]
5+
//! });
6+
//! int r = bit.walk2(sum);
7+
//! // Returns min r s.t. sum of [0,r] >= sum
8+
//! // Returns n if sum of [0,n-1] < sum
9+
//! @endcode
210
//! @time O(n + q log n)
311
//! @space O(n)
412
// NOLINTNEXTLINE(readability-identifier-naming)

library/data_structures_[l,r]/bit_uncommon/walk_lambda.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
//! @code
2-
//! bit.walk([&](int r, ll sum) -> bool {
3-
//! // sum = a[0] + a[1] + ... + a[r]
4-
//! });
5-
//! @endcode
61
void walk(const auto& f) {
72
ll sum = 0;
83
for (int i = bit_floor(size(s)), r = 0; i; i /= 2)

0 commit comments

Comments
 (0)