update the ith value if the rth array by x and return the new root of the array
| 36 | } |
| 37 | // update the ith value if the rth array by x and return the new root of the array |
| 38 | int upd(int r, int i, T x) { |
| 39 | root.push_back(upd(root[r], i, x, 0, n - 1)); |
| 40 | return root.size() - 1; |
| 41 | } |
| 42 | node* upd(node* pre, int i, T x, int l, int r) { |
| 43 | node* cur = new node(); |
| 44 | if (l == r){ |