ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1375. Bill Clevers

why I have WA#10?
Posted by test_programs 14 Sep 2005 17:27
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?
Posted by Burunduk1 14 Sep 2005 22:57
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