Company: Texas
Difficulty: medium
The Encrypted Array An unknown array `A` has `N` elements. Every intercepted query gives the sum of a subarray `A[L..R]`, but the numeric sum values themselves are not needed for this task. For each position, determine whether its value can be uniquely deduced from the query structure. Print `1` for a deducible position and `0` otherwise. Input Format The first line contains `N` and `Q`. Each of the next `Q` lines contains `L` and `R`, describing one known range sum. Output Format Print a binary string of length `N`. Constraints `1 <= N, Q <= 100000`, `1 <= L <= R <= N`. Notes Let `P[i]` be the prefix sum through position `i`. A query connects `P[L-1]` and `P[R]`. Element `A[i]` is deducible exactly when `P[i-1]` and `P[i]` belong to the same connected component. Thus the actual intercepted sum values do not affect this yes/no output.