Page 1 of 1

Problem 372

Posted: Sat Feb 18, 2012 3:12 pm
by ldesnogu
The problem says:
M<x≤N, M<y≤N and [x2/y2] are odd
Shouldn't that be:
M<x≤N, M<y≤N and [x2/y2] is odd

Re: Problem 372

Posted: Sun Feb 19, 2012 3:04 am
by subu
[flash=]They both are one at the same[/flash]

Re: Problem 372

Posted: Sun Feb 19, 2012 3:47 am
by TripleM
It should be 'is', yes.

Re: Problem 372

Posted: Sun Feb 19, 2012 9:36 am
by hk
TripleM wrote:It should be 'is', yes.
Changed.

Re: Problem 372

Posted: Fri Feb 24, 2012 2:59 pm
by petersc
I am having trouble understanding why my solution works for R(100,10000) and not for R(2000000,1000000000). I am using 64 bit unsigned long variables, which should accommodate 10^18 just fine, any hints?

Re: Problem 372

Posted: Sat Feb 25, 2012 12:47 am
by AbsoluteConvergence
I'm having a similar problem, my algorithm checks out for everything I was able to verify by a brute force alternative, but fails for R(2*6^10,10^9), I'm using python so there shouldn't be problems with large numbers. Unfortunately it also took 92 hours to run.

Re: Problem 372

Posted: Fri Mar 09, 2012 11:14 am
by arechitsky
i found solution for O( K*log(K) ), where K is about 106, so, it work, but gives wrong answer :(. It work absolutely correct at R(0,100) (comparing with bruteforce) and gives right answer at R(100,10000), but answer at R(2*106, 109) is not correct. I'm using python 3.2, any hints?

UPD: I tried numpy, other answer, but incorrect too

Re: Problem 372

Posted: Fri Mar 09, 2012 10:30 pm
by Marcus_Andrews
Always double-check any overflow or precision issues.