Find a Value of a Mysterious Function Closest to Target
Answer static range-AND queries in O(1) with a sparse table, then binary search each left end for the closest AND to the target.
Answer static range-AND queries in O(1) with a sparse table, then binary search each left end for the closest AND to the target.