1 / 8
Sep 2006

I don't understand why I am having Time Limit Exceed with my Python program to solve the FCTRL problem.
The result of the function is instantly to solve it for 1000000000.

It is maybe a problem for managing the inputs.

Can you help me please?

8 months later

I'm getting TLE too. But lot's of people have managed to solve this one in Python, so there must be way. Can someone who has solved it shed some light?

Thanks in advance.
Muntasir

Hi,

You should consider power of 5 ...

Good Luck
Cyril

Thanks for your reply.
I have considered powers of 5. Not considering powers of 5 would have resulted in a 'Wrong Answer'. I'm getting a TLE. Can you suggest any other reasons?

Muntasir

Maybe the problem is in how fast is your program read the data to be processec.
I use sys module to be able to read data from sys.stdin.readline

Cyril

My pleasure Muntasir.

Do you always program with Python or do you use other languages?
I do always use Python even if for some problem it is not easy to get an Accepted solution.

Actually, I use C, C++ and Java most of the time. I am new to Python and Perl. In general my policy is to use the language best suited to each particular problem, thus I use Python for problems that involve big numbers, for instance. But I also try to solve the easier problems, like this one, in Python to get some practice.