Solution TLEs in PyPy 2 but ACs comfortably in Python 2

Правка en1, от Lance_HAOH, 2017-12-01 18:44:33

Hi. I have been experimenting with Python for CP lately. I read from various sources, including this, that running Python code in PyPy 2 will speed up runtime by a lot as compared to the Python 2 interpreter. Tests that I performed in the SPOJ enormous input test seemed to confirm this.

I recently tried to solve another problem on CodeForces using Python. I submitted the exact same code using both PyPy 2 and Python 2 options. However, the PyPy option clearly got TLE while the Python 2 option got AC comfortably.

My submissions using PyPy 2 and Python 2.

I am unable to explain this contradiction as I am new to Python. Is any Python expert here able to explain this strange occurrence please? Thanks in advance.

Теги #python, #pypy

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Lance_HAOH 2017-12-01 18:44:33 1033 Initial revision (published)