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 1011. Conductors

Why WA #5?
Posted by nastya 22 Jun 2008 19:47
The follwing is my pgm. Could some give a test case not satisfied here?
var
s1,i:integer;
f:boolean;
a2,b2,a1,b1,a,b:real;
begin

 f:=false;
 read(a);
 read(b);
 a1:=a/100;
 b1:=b/100;
 if b<>0 then
 i:=trunc(1/b1);
 a2:=a1*(i);
 b2:=b1*(i);
 while not f do
    begin
   if (((trunc(b2)<>trunc(a2)))and (frac(b2)<>0)   then f:=true;
   a2:=a2+a1;
   b2:=b2+b1;
   i:=i+1;
 end;
 i:=i-1;
 writeln(i);

end.
Re: Why WA #5?
Posted by David Yin [ECUPL] 5 Nov 2016 14:38
Got ac by using double not float by accepting the input, so wired.