Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

HG_90's blog

By HG_90, history, 6 years ago, In English

https://mirror.codeforces.com/contest/1364/submission/85603351

pls tell me why the above code shows runtime error on test case 6.

Someone pls correct this code

  • Vote: I like it
  • +5
  • Vote: I do not like it

| Write comment?
»
6 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

You could assert that the set is not empty here auto it = s_minus_sq.begin(); before dereferencing it.

  • »
    »
    6 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it +5 Vote: I do not like it

    Yeah, that's working thanks!

    But I think that the condition never arrives at which s_minus_sq.size() is 0 and control is at else if . That's why I haven't checked that condition.

    Can you tell me what lead you to that?

    • »
      »
      »
      6 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      The Checker Diagnostics looks like access to "bad" memory, and I did not see any other line of suspicious code.