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

Автор hackslash_123, история, 6 лет назад, По-английски

In yesterday's Educational round contest(link), my solution for problem C got failed on system testing, but the same solution got passed when I submitted again after the contest . Can anyone help me out ?

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

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

You tried to reach negative array index when you are trying to get the sum. Change low to 1 and you will not encounter undefined behaviour. Sometimes even Undefined Behaviour could pass. It's a bit of random thing.