We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
thank's for this nice excercise.
I just have one plea:
I put a lot of effort in solving this challenge. After getting timouts on every trial, I even started to use a caching approach to cach partial calculations, but in the end I recognized, that I still got timeouts. And I mean, almost every test case encountered a timeout.
In the end I downloaded one of the test cases because I couldn't explain this behaviour myself. After also putting another big time in profiling, I finally recognized, that about 90% or more of the runtime was consumed by the printing logic, which I can't even influence.
I would ask you, to overthink the timing restrictons you use. They seem to be very irrealistic for python3!
On my machine, which is a Athlon (about 7 to 8 years old), test case runs in about 0,3 seconds if y disabble the print-messages (without formatting options!) and over 3 seconds if I activate them (btw. to get the 3 seconds, I even redirect stdout to > /dev/null, so it is not a matter of text scrolling in a terminal, which consumes the time!!!).
So I would really say, that your timinig restrictions for Python are irrealistic, except for, you expect the programmer to optimize the print performance as well).
Kind regards
Jott
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Divisor Exploration
You are viewing a single comment's thread. Return to all comments →
Hi,
thank's for this nice excercise. I just have one plea:
I put a lot of effort in solving this challenge. After getting timouts on every trial, I even started to use a caching approach to cach partial calculations, but in the end I recognized, that I still got timeouts. And I mean, almost every test case encountered a timeout.
In the end I downloaded one of the test cases because I couldn't explain this behaviour myself. After also putting another big time in profiling, I finally recognized, that about 90% or more of the runtime was consumed by the printing logic, which I can't even influence.
I would ask you, to overthink the timing restrictons you use. They seem to be very irrealistic for python3! On my machine, which is a Athlon (about 7 to 8 years old), test case runs in about 0,3 seconds if y disabble the print-messages (without formatting options!) and over 3 seconds if I activate them (btw. to get the 3 seconds, I even redirect stdout to > /dev/null, so it is not a matter of text scrolling in a terminal, which consumes the time!!!).
So I would really say, that your timinig restrictions for Python are irrealistic, except for, you expect the programmer to optimize the print performance as well).
Kind regards Jott