retr0coderxyz's blog

By retr0coderxyz, history, 5 years ago, In English

Hello guys,

https://codeforces.net/contest/1324/submission/73157058 fails at test 99 because of this

error

But this works fine in local compiler for the same test case. can anybody point out my mistake?

Thanks!

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

It does tell you the error!

 Error: attempt to subscript container with out-of-bounds index 2, but container only holds 2 elements.

The reason you index out of bounds is because you have an error on this line

if(j+1<arr.size())

the check should have been

if(j+1<arr[i].size())