Eramoni's blog

By Eramoni, 5 years ago, In English

I have learnt from this site that n! modulo p where p is a prime, can be calculated using Wilson's Theorem and FFT with complexity sqrt(p).(log p)^3

There is also a problem using the idea in SPOJ. link

But I am not being able to implement the idea. If anyone have any implementation of the problem please feel free to share.

Thanks for your time. Happy Coding.

Full text and comments »

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

By Eramoni, 5 years ago, In English

I am stuck on this following problem:

Given two strings of size n and m (1<=n,m<=100000), find the number of common substrings between this strings.

It will be really helpful if you can give me a solution.

Full text and comments »

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

By Eramoni, history, 5 years ago, In English

Recently I have learnt about block-cut tree and acknowledged that using block-cut tree one can solve "if two nodes are in same biconnected component" type problems.

But I don't know how to do this.

If anyone knows about this problem, please enlighten me.

Thanks for your time. Happy Coding!

Full text and comments »

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