Re: [algogeeks] Re: spoj--two squares problem

2011-05-29 Thread Pradip Singh
use long long int instead of int for X and all except t.and type cast the sqrt returned value to integer..like int(sqrt(X)) On Sun, May 29, 2011 at 1:55 PM, Vishal Jain wrote: > Hi Saurabh, > > Can you try it for 10? Could not really understand, what are you gonna > communicate? > > 10 = 2*5 (2^

Re: [algogeeks] Re: spoj--two squares problem

2011-05-29 Thread Vishal Jain
Hi Saurabh, Can you try it for 10? Could not really understand, what are you gonna communicate? 10 = 2*5 (2^2 + 1^2 )*(1*2 + 1^2)... If with this logic you are saying 10 is prime then all numbers divisible by 5 should be prime. Could you elaborate your answer more? Thanks & Regards Vishal Jain

Re: [algogeeks] Re: spoj--two squares problem

2011-05-28 Thread saurabh singh
In fact we can...though not directly..SInce every number can be broken down as facotrs of primeUse that property On Sun, May 29, 2011 at 1:12 AM, Tushar Bindal wrote: > that theorem is for odd primes > 9 is not an odd prime > so we can;t apply this theorem > > > -- > You received this messag

Re: [algogeeks] Re: spoj--two squares problem

2011-05-28 Thread Tushar Bindal
that theorem is for odd primes 9 is not an odd prime so we can;t apply this theorem -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to

Re: [algogeeks] Re: spoj--two squares problem

2011-05-27 Thread Balaji S
what if c=9.. 9%4=1 ryt? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options,

[algogeeks] Re: spoj--two squares problem

2011-05-27 Thread bittu
@ashish you forget one condition that c=x^2+y^2 iff c= 1 mod(4) e.g. c %4==1 & also x!=y see above link its great & simple. Thanks to Fermat & Euler Thanks Shashank -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, s

[algogeeks] Re: spoj--two squares problem

2011-05-26 Thread ricky
thanks :) it worked. cheers On May 25, 12:12 pm, Saikat Debnath wrote: > I think your problem is you are using int. Use long long. > > > > > > > > On Thu, May 26, 2011 at 12:29 AM, ricky wrote: > > can anyone help me out with this problem: > >https://www.spoj.pl/problems/TWOSQRS/ > > It runs on