ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1705. Gangster Hares

Any hints
Posted by VNXtreMe 4 Jan 2012 14:46
I got TLE on testcase 3 and I know test3 is testing near 10^18. Im using the square root method to solve the problem and the loop starts with the value from the square root function. However for numbers that are close to 10^18, the loop will run approximately 30,000 times and I know this is the problem with my solution. Can anyone tell me some ways that I could use to make the solution faster?

btw I'm doing this in C++.

Thanks :)