Skip to content

Commit 4c980b2

Browse files
lrvideckisweb-flow
andauthored
golf (#174)
* Refactor nxt function for segment tree * [auto-verifier] verify commit 83667d0 --------- Co-authored-by: GitHub <noreply@github.com>
1 parent 3021ec1 commit 4c980b2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.verify-helper/timestamps.remote.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"tests/library_checker_aizu_tests/data_structures/rmq_sparse_table.test.cpp": "2026-01-18 11:15:41 +0000",
4545
"tests/library_checker_aizu_tests/data_structures/rmq_sparse_table_inc.test.cpp": "2026-01-18 11:15:41 +0000",
4646
"tests/library_checker_aizu_tests/data_structures/simple_tree.test.cpp": "2026-01-18 11:15:41 +0000",
47-
"tests/library_checker_aizu_tests/data_structures/simple_tree_inc.test.cpp": "2026-01-22 19:22:57 -0700",
48-
"tests/library_checker_aizu_tests/data_structures/simple_tree_inc_line.test.cpp": "2026-01-22 19:22:57 -0700",
47+
"tests/library_checker_aizu_tests/data_structures/simple_tree_inc.test.cpp": "2026-01-22 19:46:25 -0700",
48+
"tests/library_checker_aizu_tests/data_structures/simple_tree_inc_line.test.cpp": "2026-01-22 19:46:25 -0700",
4949
"tests/library_checker_aizu_tests/data_structures/simple_tree_line.test.cpp": "2026-01-18 11:15:41 +0000",
5050
"tests/library_checker_aizu_tests/flow/dinic_aizu.test.cpp": "2024-11-17 14:04:03 -0600",
5151
"tests/library_checker_aizu_tests/flow/hungarian.test.cpp": "2024-11-17 14:04:03 -0600",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
//! @time O(n + q log n)
1212
//! @space O(n)
1313
int nxt(int& l, int r) {
14-
int x = __lg(min(l & -l, r - l + 1));
15-
return exchange(l, l + (1 << x)) >> x;
14+
int x = l, y = __lg(min(l & -l, r - l + 1));
15+
return l += 1 << y, x >> y;
1616
}
1717
template<class T, class F> struct tree {
1818
int n;

0 commit comments

Comments
 (0)