We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e38ace commit 12b42edCopy full SHA for 12b42ed
library/data_structures_[l,r]/seg_tree_uncommon/init.hpp
@@ -2,6 +2,5 @@
2
tree(const vector<T>& a, F op):
3
n(sz(a)), op(op), s(2 * n) {
4
rep(i, 0, n) s[i + n] = a[i];
5
- for (int i = n - 1; i >= 1; i--)
6
- s[i] = op(s[2 * i], s[2 * i + 1]);
+ for (int i = n; --i;) s[i] = op(s[2 * i], s[2 * i + 1]);
7
}
0 commit comments