hellodummy's blog

By hellodummy, 4 years ago, In English

The following is taken from cp-algorithms

copy-pasted-part starts:

The task is as follows: for a given value x and a range a[l…r] find the smallest i in the range a[l…r], such that a[i] is greater than x.

This task can be solved using binary search over max prefix queries with the Segment Tree. However, this will lead to a O(log2n) solution.

Instead, we can use the same idea as in the previous sections, and find the position by descending the tree: by moving each time to the left or the right, depending on the maximum value of the left child. Thus finding the answer in O(logn) time.

copy-pasted-part ends

Here's the link: Link

I am not able to understand the implementation of this problem. Can anyone please help me?

Thank you so much!

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By hellodummy, history, 4 years ago, In English

Please list all the websites that are related to codeforces.

I currently know of these two:

Link1

Link2

Thank you.

Full text and comments »

  • Vote: I like it
  • +13
  • Vote: I do not like it

By hellodummy, history, 4 years ago, In English

Why are problems in div 2 rounds made so difficult? Majority of the div 2 official participants are able to solve till problem C or at max problem D in some rounds.

If div 1 users weren't allowed to participate during the live div 2 round, then problems after D or E would see only a handful of submissions.

The point I'm trying to say is that at least keep the problems in such a manner that majority are able to solve them, and then time of submission would be the key to deciding the ranks.

If div 2 users want to improve upon their coding skills then div 1 questions are always open.

PS: I'm open to suggestions and feedback. I may be wrong as well, but I think in this way.

Cheers!

Full text and comments »

  • Vote: I like it
  • -24
  • Vote: I do not like it

By hellodummy, history, 4 years ago, In English

There was a blog titled "Important Website Missing" a couple of days ago, but now I think it has been deleted.

I wanted the website links that other users provided in the comments. Anyone?

Full text and comments »

  • Vote: I like it
  • -9
  • Vote: I do not like it

By hellodummy, history, 4 years ago, In English

Why are all the problems written on 1 based indexing and not on 0 based.

Any particular reason behind this?

Thank you.

Full text and comments »

  • Vote: I like it
  • +4
  • Vote: I do not like it