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

Автор CandidFlakes, история, 10 месяцев назад, По-английски

Please look at this submission. I am getting out of bounds error on line number 42. I have checked my code multiple times and also made sure that the vector 'a' is accessed up to i=a.size()-2 only, so that a[i+1] doesn't go out of bound.

Please help me identify my mistake.

I will be thankful for any help!

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

»
10 месяцев назад, # |
Rev. 2   Проголосовать: нравится +7 Проголосовать: не нравится

Captain Obvious to rescue:

If a.size() == 1 then a.size() - 2 == numeric_limits<size_t>::max() - 1

P.S. In DM I got corrected, it just numeric_limits<size_>::max()