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

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

I wrote a code for the solution to the problem C-Berland Regional but I am getting runtime error on test 7. I tried finding out what exactly can be the error but I couldn't get any. Most of the variables are long long so overflow can't happen and I have applied conditions to check if the indices are in bound or not but still it's giving runtime error. I am not sure what the mistake is. Please help me out in finding out the mistake.

Here is a link to my solution. Thank you.

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

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

your comparator returns true if elements are equal, so just change >= to > in 21st line

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

    Thank you. It is clear now.