Unofficial Editorials November Long Challenge (Part 2)

Really @vijju123??

Is this the case?? Are the solutions with same approach but different languages are getting different verdicts?? This is a matter of serious concern as this would cause unfair advantage to some. I would really hate this if something of this sort happens.

I guess this need strict action. Perhaps it should be made responsibility of problem tester to solve the problem with same approach using c++, python(PYPY or CPYTH) and Java, for these three languages are most popular ones. Hope this matter won’t go unnoticed.

Maybe vectors are the reason. Rest i didn’t exactly got the gist of your solution. Maybe u should try same solution using arrays, or add a bit of explanation about ur approach

I am not able to solve any of the last three problems (full solution). But i have texted someone to explain me approach of POLY. Whenever that person replies, i’ll solve the problem and then write editorial.

Waiting for that person’s reply. :slight_smile:

If you can find anyone willing to explain his approach to me, i would be glad to write an editorial on any of last three problems and give him due credit as well.

Setter’s solution runs in 2.5 seconds…horror

@vijju123, Unluckily, That person got some unavoidable reasons, keeping that person busy, because of which I cannot do an editorial on POLY unless anyone else is willing to help me.

Sorry for inconvenience.

@taran_1407 you don’t necessarily have to make 2 segment trees. Since the working of the 2 segment trees is exactly the same, I made a class for segment trees and used 2 objects of that class as mentioned above. It made the code look clean and simple. Here’s the code.

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

Mate, i too used one segtree only. Thanks for sharing. :slight_smile:

1 Like

@taran_1407 There is no binary search.

One of the most unique and brilliant solution i have every heard, repeated application of sqrt decomposition to get query time O(1).

I would be glad to see ur submission. Thanks for sharing ur approach friend.

PS:if u r willing, i am recieving request for editorial of POLY, but wasn’t able to solve that one. If u r willing to share ur approach with me, that would be really helpful. Be assured, due credit will be given to u. If u urself want to write editorial, that would also be welcome. In case u r busy, no problem mate!!!

2 Likes

Thanks for this approach, I’m sure I can’t implement this. Looking forward to viewing your submission :smiley: Once again, thanks a lot buddy :slight_smile:

@eugalt, I’m not much in c++, but i thought lowerbound function uses binary search. Correct me if I’m wrong. :slight_smile:

@taran_1407 There is lower_bound() function in the algorithms library which uses binary search on an iterator range. Here it’s a map/set method with the same name.

Setter’s solution works in 2.5 sec holy shit :open_mouth: O_O

Oh by god… @vijju123

Well, I hope you convey this suggestion to admin. There should be proper testing in these three languages at least. No one should ever get undue advantage just because of a particular language.

Hope once again, This matter won’t go unnoticed.

Thanks mate!!

found[i][0] tells whether ith block contains atleast one value > R and found[i][1] tells whether ith block contains atleast one value >=L.

Happens, mate. You are not the first one for this, nor you will be the last. I too wasted nearly 12 submissions (WA Segment tree ones) on CSUBQ because of a variable mistake. Just changed variable and got AC.

May be U should try iterative versions of exponentation and mod Inverse, as they tend to be slightly faster.

Well, an algorithm is always simple to its writer. :slight_smile:

It would be a bit easier for me as well as other very helpful contributors to help u if u explain your logic a bit.

what does array arr do in your solution. It would help others to help u. :slight_smile:

I did only 30. :smiley: