Skip to content

Commit 7d3b8c0

Browse files
committed
fix test
1 parent cc38fbb commit 7d3b8c0

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

tests/library_checker_aizu_tests/data_structures/bit_inc_walk.test.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,13 @@ int main() {
2323
if (bit.query(k, n - 1) == 0) cout << -1 << '\n';
2424
else {
2525
ll order = bit.query(k - 1);
26-
int res = -1;
27-
bit.walk([&](int r, ll sum) {
28-
if (sum <= order) return 1;
29-
res = r;
30-
return 0;
31-
});
32-
cout << res << '\n';
26+
cout << bit.walk(order + 1) << '\n';
3327
}
3428
} else {
3529
if (bit.query(k) == 0) cout << -1 << '\n';
3630
else {
3731
ll order = bit.query(k);
38-
int res = -1;
39-
bit.walk([&](int r, ll sum) {
40-
if (sum >= order) {
41-
res = r;
42-
return 0;
43-
}
44-
return 1;
45-
});
46-
cout << res << '\n';
32+
cout << bit.walk(order) << '\n';
4733
}
4834
}
4935
}

0 commit comments

Comments
 (0)