Skip to content

Commit 12b42ed

Browse files
committed
golf constructor
1 parent 4e38ace commit 12b42ed

File tree

1 file changed

+1
-2
lines changed
  • library/data_structures_[l,r]/seg_tree_uncommon

1 file changed

+1
-2
lines changed

library/data_structures_[l,r]/seg_tree_uncommon/init.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
tree(const vector<T>& a, F op):
33
n(sz(a)), op(op), s(2 * n) {
44
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]);
5+
for (int i = n; --i;) s[i] = op(s[2 * i], s[2 * i + 1]);
76
}

0 commit comments

Comments
 (0)