KadiyalaSaiManoj's blog

By KadiyalaSaiManoj, history, 9 years ago, In English

In some of the problems i have done in codeforces, some algorithms which pass in c are not passing in python. As most of you know python is slower, but this should not be a problem, sometimes pypy2 is fast enough to pass the time limit, but pypy3 is still weak and is sometimes slower than python3 , so for users using python3 this is becoming a problem.

This can be solved by creating a list of factors for each language which you multiply to the time limit to make the python3 codes pass.

Eg: if time limit is 2 sec

LanguageFactorTime Limit
C/C++1.02 sec
java2.04 sec
python2/3/pypy34.08 sec
pypy22.04 sec

These factors are just my opinion and can be decided by the CF team, I am not asking for the exact time limits as above but just asking to consider language wise time limits.
What do you people think?

I think hackerrank uses extended time limits, do any other site use it?
Hackerrank time limits

Have anyone faced similar problems like this.

Full text and comments »

  • Vote: I like it
  • -41
  • Vote: I do not like it

By KadiyalaSaiManoj, history, 9 years ago, In English

It seems python has a low recursion Limit creating problems like runtime error. I have faced this problem in the following questions. It seems we have to use sys.setrecursionlimit().

667C - Reberland Linguistics without using sys.setrecursionlimit 18166330.

passed 18165938.

but this is also not working in some cases

445A - DZY Loves Chessboard (python3 runtime-error with limit set) 18166280.

(python2 same code) 18166286

Can anyone shed some light over this topic

did anyone face similar problems with python and why python3 is failing and python2 is passing with eventhough i set recursionlimit explicilty.

Thanks

Full text and comments »

  • Vote: I like it
  • +6
  • Vote: I do not like it