https://www.hackerearth.com/problem/algorithm/submatrixqueries7e459f97/ can anybody explain how to solve this problem for 100 points? ......It's not a live contest question. thank you in advance!! asked 31 Dec '18, 03:32

You can check out my solution: https://www.hackerearth.com/submission/22611281/ The short explanation of my solution is to have a dynamic segment tree for each possible value of x (only 0255). Then for each value x in the array, add it to every segment tree that represents a value whose bit representation is a subset of the bit representation if x. Then for each query use inclusion exclusion on supersets of the desired value in bit representation. I know this is a quick and dirty explanation. Feel free to ask follow up questions after reading the code. answered 04 Jan, 12:45

Answer is hidden as author is suspended. Click here to view.
answered 04 Jan, 20:04

Please explain how to solve the AND QUERY problem, and if possible make a editorial for it. Link : https://www.hackerearth.com/problem/algorithm/submatrixqueries7e459f97/ answered 05 Jan, 11:28
