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

Автор retr0coderxyz, история, 4 года назад, По-английски

Hello guys,

https://codeforces.com/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!

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

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

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())