How Many Intervals Cover X — Solution & Editorial
Difference array over the coordinate range, prefix-summed once; each query is an array lookup.
Complexity: O(N + Q + C)
Difference array over the coordinate range, prefix-summed once; each query is an array lookup.
Complexity: O(N + Q + C)