mamakancha's blog

By mamakancha, history, 8 years ago, In English

I am trying to solve problem 152C, Pocket Book . Here is my code

It is giving wrong answer on a test case. However, logic which I am using is perfectly fine according to me. Where is the problem in my code?

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

| Write comment?
»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

You need to take the rest modulo 1e9 + 7 every time you multiply prod, after that you should get AC :)