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

Автор duckladydinh, история, 6 лет назад, По-английски

Hallo Codeforces Hackers,

could you tell me what can possibly go wrong with the following submission? I even changed all ints to long long just in case, but I cannot seem to find out why. It passed all except for test 4_hand_3, what can be in that test? My solution looks the same as that in the tutorial (though I do not know Japanese).

Submission: https://beta.atcoder.jp/contests/abc110/submissions/3261324

Thank you very much.

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

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

I was facing a problem which got resolved once I increased the size of the array. You can see my submission here.

You can also try increasing the sum of your arrays as it is possible for it to be 2 x 10^5 in the worst case. :)

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

    Even though I did prove that it should be around 10^5 + 30, but yes I did increase the size but not in this case :D

    Thank you anyway

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится +18 Проголосовать: не нравится

You're not initializing inv[0] to 1, you will use it in the case of N = 1. Your code became AC with this change only: submission link.