CreativeAss's blog

By CreativeAss, history, 6 years ago, In English

Average time of quick sort is O(nlogn). So in many contest n is like 5*10^5 at that time nlogn would be ~10^7 operations. Considering not worst but some bad case the sorting can take around ~(4*10^8 — 5*10^8) operations and give a Time Limit Exceeded.

Now I wanted to know that can this type of case happen during a submission in Codeforces or It can never happen.

Sorry for silly question.

Thanks in advance.

Full text and comments »

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

By CreativeAss, history, 6 years ago, In English

We can find out the total number of distinct substrings in the string by substracting the LCP (longest common prefix) of the suffix at each index with the suffix at the previous index.

Can someone help me in proving this?

Thanks in advance

Happy Coding

Full text and comments »

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

By CreativeAss, history, 6 years ago, In English

How to handle parallel edges while finding bridges?

I know one way that count occurrence of each edge. After taking input if occurrence of an edge is greater than 1 don't consider it. (As it will never be a bridge).

I wanted to know some other way.

Thank you very much in advance :) Happy Coding

Full text and comments »

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