| 3 | int l, r, lid, rid, sum; |
| 4 | } segs[2000000]; |
| 5 | int build(int l, int r) { |
| 6 | if (l > r) return -1; |
| 7 | int id = segcnt++; |
| 8 | segs[id].l = l; |
| 9 | segs[id].r = r; |
| 10 | if (l == r) segs[id].lid = -1, segs[id].rid = -1; |
| 11 | else { |
| 12 | int m = (l + r) / 2; |
| 13 | segs[id].lid = build(l , m); |
| 14 | segs[id].rid = build(m + 1, r); } |
| 15 | segs[id].sum = 0; |
| 16 | return id; } |
| 17 | int update(int idx, int v, int id) { |
| 18 | if (id == -1) return -1; |
| 19 | if (idx < segs[id].l || idx > segs[id].r) return id; |
nothing calls this directly
no outgoing calls
no test coverage detected