暴力+构造
If r - l ≤ 4 we can all subsets of size not greater than k.
Else, if k = 1, obviously that answer is l. If k = 2,
answer is 1, because xor of numbers 2x and 2x + 1 equls 1.
If k ≥ 4 answer is 0 because xor of
to pairs with xor 1 is 0.
If k = 3, we can choose numbers 2x and 2x + 1 with xor 1.
So we need to know, if we can get xor equals 0. Suppose that
there are 3 such numbers x, y and z (r ≥ x > y > z ≥ l)
with xor equals 0. Consider the most non-zero bit of nu......
阅读全文