I_am_Mahi's blog

By I_am_Mahi, history, 5 hours ago, In English

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.

  • Vote: I like it
  • -8
  • Vote: I do not like it

»
5 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

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

  • »
    »
    2 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thank you. It is clear now.