Dumbledore's blog

By Dumbledore, history, 9 years ago, In English

I have a problem were I need to answer two kinds of queries. The first query is to change the value of number at index i of the array to x. The second one is to find the number of elements lesser than x in (index) range [0, r]. Could you help me on this?
Thank you in advance.

Full text and comments »

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

By Dumbledore, history, 9 years ago, In English
for (int i = 1; i <= MAXN; i++)
     for (int j = i; j <= MAXN; j += i);


Can anybody explain to me why the time complexity for this code is O(N log N)?

Full text and comments »

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

By Dumbledore, history, 9 years ago, In English

A wise man once said.

“Nitwit! Blubber! Oddment! Tweak!”

And that was me.


Wow.

Full text and comments »

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