Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .verify-helper/timestamps.remote.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"tests/library_checker_aizu_tests/data_structures/rmq_sparse_table.test.cpp": "2025-08-14 12:01:15 -0600",
"tests/library_checker_aizu_tests/data_structures/rmq_sparse_table_inc.test.cpp": "2024-12-15 14:34:10 -0600",
"tests/library_checker_aizu_tests/data_structures/simple_tree.test.cpp": "2024-12-14 15:47:13 -0600",
"tests/library_checker_aizu_tests/data_structures/simple_tree_inc.test.cpp": "2024-12-21 00:23:10 -0500",
"tests/library_checker_aizu_tests/data_structures/simple_tree_inc_line.test.cpp": "2024-12-21 00:23:10 -0500",
"tests/library_checker_aizu_tests/data_structures/simple_tree_inc.test.cpp": "2026-01-15 14:21:06 -0700",
"tests/library_checker_aizu_tests/data_structures/simple_tree_inc_line.test.cpp": "2026-01-15 14:21:06 -0700",
"tests/library_checker_aizu_tests/data_structures/simple_tree_line.test.cpp": "2024-12-14 15:47:13 -0600",
"tests/library_checker_aizu_tests/flow/dinic_aizu.test.cpp": "2024-11-17 14:04:03 -0600",
"tests/library_checker_aizu_tests/flow/hungarian.test.cpp": "2024-11-17 14:04:03 -0600",
Expand Down
14 changes: 6 additions & 8 deletions library/data_structures/seg_tree_inc.hpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#pragma once
//! https://codeforces.com/blog/entry/118682
//! @code
//! {
//! tree_inc st(n, pii{}, [&](pii& l, pii& r) {
//! return min(l, r);
//! });
//! }
//! tree_inc st(n, int{}, ranges::min);
//! rep(i, 0, n) st.update(i, a[i]);
//! tree_inc st1(n, pii(0, 0), [&](pii& l, pii& r) {
//! return min(l, r);
//! });
//! tree_inc st2(n, (int)0, ranges::min);
//! tree_inc st3(n, (ll)0, plus<ll>{});
//! @endcode
//! @time O(n + q log n)
//! @space O(n)
Expand All @@ -19,7 +17,7 @@ template<class T, class F> struct tree_inc {
int n;
F op;
vector<T> s;
tree_inc(int n, T, F op): n(n), op(op), s(2 * n) {}
tree_inc(int n, T x, F op): n(n), op(op), s(2 * n, x) {}
void update(int i, T val) {
for (s[i += n] = val; i /= 2;)
s[i] = op(s[2 * i], s[2 * i + 1]);
Expand Down
Loading