Test case failed in python cleared in pypy

Codeforces educational round 84 problem B problem link

I submitted the same code in python3.7 and pypy3, however I got an error on a test case(test case 2) in python while same code cleared that test case in pypy.

Python submission
pypy submission

What might be the reason for this?

1 Like

pypy is almost always more faster than python(by around a factor of 2)

I agree with you but have a look at this,

I wrote another code for my problem and sumitted in pypy, verdict TLE pypy submission link
Same code when submitted in python, verdict Accpted python submission link

Since I always used pypy over python in contests, I might get TLE instead of AC although my code is correct which is kinda worrying.

Help pls, I am all confused now

learn c++ because many problems are there which cannot be done using either pypy or python.I also had to do this.It looks tougher than it actually is.

generally pypy is much faster though exceptions always exist

It is always better to use pypy2 with fast IO template (can find here). For better learning , you can learn from solutions of @panik. He only uses pypy2 and is a 6-star guy (my inspiration)