pages:
  • 1
H__M SAYS

Same algorithm that got Accepted using C++, got TLE using Python. Maybe 15-second-time-limit is a little too tightbound for this problem...!!!

AMiR SAYS

H__M said:

Same algorithm that got Accepted using C++, got TLE using Python. Maybe 15-second-time-limit is a little too tightbound for this problem...!!!

The input file for this problem is a little huge. I don't know if there is any faster methods in python for IO operation but I belive using faster methods will reduce the execution time by far.

Your python code on the judge server took 40 seconds to terminate.

H__M SAYS

AMiR said:

H__M said:

Same algorithm that got Accepted using C++, got TLE using Python. Maybe 15-second-time-limit is a little too tightbound for this problem...!!!

The input file for this problem is a little huge. I don't know if there is any faster methods in python for IO operation but I belive using faster methods will reduce the execution time by far.

Your python code on the judge server took 40 seconds to terminate.

Yes, I believe that's the most likely cause.

In any case, thanks for the details of execution time.

H__M SAYS

By the way, is the "psyco" module available on the server? Using it is a good way to boost the performance in python code. I've seen some of the online judges have installed that module and suggested using it for better performance.

AMiR SAYS

H__M said:

By the way, is the "psyco" module available on the server? Using it is a good way to boost the performance in python code. I've seen some of the online judges have installed that module and suggested using it for better performance.

I'm not sure if this module have security issues for the judge server or not. I will notify the judge core team to study about that.

Thank you :)