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

×

BINSTR - No Editorial Here xD

I have solved this problem by compressing a Trie (think it is called Radix Tree). Is there other way to solve this problem (with something more simple)?

asked 12 Nov '18, 21:51

gustavogardusi's gravatar image

5★gustavogardusi
425
accept rate: 0%

edited 13 Nov '18, 07:15

aryanc403's gravatar image

5★aryanc403
2.7k1618

2

Please remove the editorial word from question title.

(12 Nov '18, 23:47) aryanc4035★

Change the heading fast or you getting down vote...
Don't keep such names to attract people to your question

(13 Nov '18, 07:08) l_returns4★

@l_returns done. xD

(13 Nov '18, 07:16) aryanc4035★
1

Okay.... :)

(13 Nov '18, 07:27) l_returns4★

@I_returns It was not my intention, sorry.

(13 Nov '18, 17:47) gustavogardusi5★

I believe I used a similar algorithm as you. I can try to explain it but it's hard to articulate.

I didn't know what it was called but I used something that looks like a poorly implemented radix tree (I failed to properly collapse all types of branch nodes with only one child). Each node in the tree held an array of indices which represent the values on that branch. I kept this so that I could search the indices to make sure that there was at least one within [L, R]. If there was exactly one I returned it's value. If there was more than one I followed the node. I always tried to follow the node which was the result of the xor for the appropriate bit. If that node wasn't populated with at least one index in [L, R] then I followed the other node.

https://www.codechef.com/viewsolution/21584591

link

answered 13 Nov '18, 00:44

browni3141's gravatar image

4★browni3141
1
accept rate: 0%

When can we expect editorial for this question?

link

answered 20 Nov '18, 15:33

dextrous's gravatar image

5★dextrous
1582210
accept rate: 0%

edited 20 Nov '18, 15:34

1

I just asked the editorialist about it... he said he will post it soon (ASAP)...

(20 Nov '18, 16:16) l_returns4★
1

Been a lot of time. This actually takes away the eagerness to know the solution. We don't expect a fancy editorial everytime, a normal text editorial would do.

(23 Nov '18, 15:04) dextrous5★

Agree with you... I also wanted to see it...

(23 Nov '18, 16:25) l_returns4★
1

Looks like it's never gonna see the light of day

(03 Dec '18, 14:34) dextrous5★
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:

×858
×186
×67

question asked: 12 Nov '18, 21:51

question was seen: 1,023 times

last updated: 03 Dec '18, 14:34