|
|
back to boardsolution Posted by Cat36 28 Oct 2008 00:08 answer == 1 - manually answer == 2 - manually answer == 3 - n%8 !=7 else answer ==4 Re: solution Posted by VakH 2 Feb 2009 20:39 and answer = 3 if ((N%32!=28)&&(N!=28)) good luck ) Re: solution Posted by melkiy 7 Mar 2009 08:13 and answer = 3 if ((N%32!=28)&&(N!=28)) How did you derive this formula? I think it worked for you because of too little test numbers. In the analogous problem #1593 N<=10^15 your formula fails. Nevertheless checking n=a^2+b^2 is at worst longer (O(sqrt(N)) than checking n=a^2+b^2+c^2 (log(N)). |
|
|