×

# AND QUERIES DECEMBER CIRCUITS

 1 1 https://www.hackerearth.com/problem/algorithm/submatrix-queries-7e459f97/ 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 4★ss_varma 11●1 accept rate: 0%

 0 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 0-255). 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 6★benjyman 1 accept rate: 0%
 0 Please explain how to solve the AND QUERY problem, and if possible make a editorial for it. Link : https://www.hackerearth.com/problem/algorithm/submatrix-queries-7e459f97/ answered 05 Jan, 11:28 0●1 accept rate: 0%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×398

question asked: 31 Dec '18, 03:32

question was seen: 333 times

last updated: 05 Jan, 11:28