PyPy3 Oddity: Useless Statement Solves Runtime Error

Revision en1, by YMSeah, 2021-08-12 13:47:53

I attempted problem B from the recent #737 (Div 2) contest and had a runtime error. I prevented that error by adding a useless line of code "j == -1":

RE submission: 125632647, AC submission: 125632637

For some context, my code performs a binary search (using a method similar to binary lifting) to find j in the increasing array b where b[j] == a[i]. Since b is the sorted copy of a, a[i] always exists in b so j != -1.

Is this a problem associated with PyPy3's JIT compiler, or am I missing something?

Tags pypy3

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English YMSeah 2021-08-12 13:47:53 640 Initial revision (published)