Tips to Avoid Off-By-One Indexing Errors?

Правка en1, от pilliamw, 2025-08-07 20:49:40

In today's contest, I found the algorithm to B relatively quickly... and then proceeded to get about 5 WAs due to off-by-one implementation errors :skull:

Are there any tips you guys use to avoid silly off-by-one errors with indices? IDK why but something about it just doesn't click for me in-contest. (Surely I'm not the only one with this issue...)

Теги off-by-one, debugging, help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский pilliamw 2025-08-07 20:49:40 395 Initial revision (published)