Range* build(int l, int r) { assert(l <= r); if (r - l == 1) { Range* range = new Range(l, r); range->data = RangeData(array[l]); return range; } Range* range = new Range(l, r); int m = l + (r - l) / 2; range->left = build(l, m); range->right = build(m, r); range->data = range->left->data ^ range->right->data; return range; }
RangeData operator ^ (const RangeData& other) { return RangeData(do_gcd(gcd, other.gcd)); }
ByteRange(const uint8_t* b, const uint8_t* e, Refer) : impl(RangeData(b, e)) {}