aajjbb's blog

By aajjbb, 11 years ago, In English

Hi.

I'm trying to solve this problem from Live Archive Link.

I'm receiving Wrong Answer and the test data isn't available online. To briefly explain my solution, I pre-process the hashing function for the whole string, and them take the hash of the slices I want from this array and apply it's inverse module to normalize the prime powers. Is there something wrong with this approach ?

My Code

Thanks in advance.

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

»
11 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Here's my AC solution: http://ideone.com/6AVLRk

You can generate random inputs and compare with your output.