Блог пользователя mahmoud_arafa

Автор mahmoud_arafa, история, 4 года назад, По-английски

Hello, I am solving a problem on Hackerrank and I got WA.

Here is the problem link.

and here is my submission.

Could you help me please with a test case as the tests that my code fails for are very large?

Thanks.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
4 года назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

I could not read your submission because it belongs to your account. You can check the following link.

My accepted C++14 solution

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Sorry, I updated my submission link.

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Ok. I can read your submission now. Your approach is correct. You just need to insert the following couple of lines after line 52 inside the for-loop.

      if (ans >= 1000000007LL)
          ans -= 1000000007LL;