XLR8ST's blog

By XLR8ST, history, 9 years ago, In English

I'm trying to do MCHEF from codechef long july 2015 . I've tried to implement what is written in the editorial but i'm constantly getting tle , The complexity of my solution seems to be enough to pass the constraints.Why am i getting TLE?? help !!

LINK TO CODE- http://pastebin.com/T5ZxchXL

Full text and comments »

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

By XLR8ST, 9 years ago, In English

How can i find the no. of distinct substrings of a string using Z-FUNCTION/Z-ARRAY ?

Time complexity should be less than O(n2).

I know there is a way using suffix array but i am more interested in solving this using Z-array/Z-function.

Full text and comments »

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