Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void build(const vector<T>& a)
- {
- int n = a.size();
- for (int i = 0; i < n; ++i)
- tree[n + i].query = a[i];
- for (int i = n - 1; i > 0; --i)
- tree[i].query = query(tree[2 * i].query, tree[2 * i + 1]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement