|
|
back to boardwhy I have WA#10? part 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 Re: why I have WA#10? 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? Re: why I have WA#10? Posted by PSV 1 Apr 2007 19:50 Yes in this stupid problem only one problem is overflows just use in64 and I'll have AC without even TL |
|
|