|
|
вернуться в форумsolution Послано Cat36 28 окт 2008 00:08 answer == 1 - manually answer == 2 - manually answer == 3 - n%8 !=7 else answer ==4 Re: solution Послано VakH 2 фев 2009 20:39 and answer = 3 if ((N%32!=28)&&(N!=28)) good luck ) Re: solution Послано melkiy 7 мар 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)). |
|
|