|
|
вернуться в форумПоказать все сообщения Спрятать все сообщенияanswer == 1 - manually answer == 2 - manually answer == 3 - n%8 !=7 else answer ==4 and answer = 3 if ((N%32!=28)&&(N!=28)) good luck ) 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)). |
|
|