You are not logged in. Please login at www.codechef.com to post your questions!

×

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

ss_varma's gravatar image

4★ss_varma
111
accept rate: 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.

link

answered 04 Jan, 12:45

benjyman's gravatar image

6★benjyman
1
accept rate: 0%

Answer is hidden as author is suspended. Click here to view.

answered 04 Jan, 20:04

karangreat234's gravatar image

4★karangreat234
(suspended)
accept rate: 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/

link

answered 05 Jan, 11:28

sagar2405's gravatar image

4★sagar2405
01
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • 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