Weird behaviour

Правка en1, от yoshi_likes_e5, 2025-03-16 07:14:32

I have this code here: https://codeforces.net/contest/444/submission/310588587. It is really weird that:

  • On custom invocation, it sometimes output 6, then after that it just do -1

  • The res[id][i] array never seems to be written to the correct value, even though I have checked for overflow and the value is correct

  • On my machine, it output 2 as normal.

  • Putting res as a global variable fixes the above.

Can anyone explains why this happen, is it a bug in my code or a bug on Codeforces?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский yoshi_likes_e5 2025-03-16 07:17:50 4 Tiny change: 'rect value, even tho' -> 'rect value (2), even tho'
en2 Английский yoshi_likes_e5 2025-03-16 07:15:07 8 Tiny change: 'es[id][i] array never see' -> 'es[id][i] value never see'
en1 Английский yoshi_likes_e5 2025-03-16 07:14:32 523 Initial revision (published)