My O(sqrt(n)) solution is timing out. Any hints are appreciated. I just dont see any different algorithm.
TIA
Vinay Emani
11490 - Just Another Problem
Moderator: Board moderators
11490 - Just Another Problem
I am signing an important document!
Re: 11490 - Just Another Problem
Hi Robert,
How did you solve it in 10ms
. Is it possible to construct the solutions
directly without searching? Thanks!
How did you solve it in 10ms

directly without searching? Thanks!
-
- New poster
- Posts: 9
- Joined: Thu Aug 21, 2008 3:08 am
- Location: IUT
Re: 11490 - Just Another Problem
can anyone give me some hint how to solve the problem quickly
-
- Experienced poster
- Posts: 196
- Joined: Wed May 02, 2007 10:12 pm
- Location: Hungary, Pest county, Halasztelek
- Contact:
Re: 11490 - Just Another Problem
The problem is equivalent to factorize n (it is a little algebra to figure out the factors) for this I've used Pollard rho method (by Brent's modification).baodog wrote:Hi Robert,
How did you solve it in 10ms. Is it possible to construct the solutions
directly without searching? Thanks!
-
- New poster
- Posts: 15
- Joined: Thu Jun 18, 2009 12:01 pm
- Contact:
Re: 11490 - Just Another Problem
My O(sqrt(S)) algorithm got AC in 1.3sNaani wrote:My O(sqrt(n)) solution is timing out. Any hints are appreciated. I just dont see any different algorithm.
TIA
Vinay Emani
