|
|
back to boardpart of my program: ... for x:=0 to p-1 do for y:=0 to p-1 do if f(x,y,p)=(k mod p) then begin writeln(x,' ',y); halt(0); end; writeln('NO SOLUTION'); end. {-----------------------------------} f(x,y,p) = ( x^2 + y^2 ) mod p x can be 10^5 so x^2 can be 10^10... (you can't store it in longint) Don't you have any overflows? Yes in this stupid problem only one problem is overflows just use in64 and I'll have AC without even TL |
|
|