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

I need help(WA 17)
Posted by Mad man 30 Apr 2006 18:55
I do not see error here, but didn't pass the 17'th test
var p,q: extended;
    a,b: longint;
BEGIN
    read(p,q); p:=p/100; q:=q/100;
    a:=1;
    while (true) do begin
       b:=1;
     while (a/b>=q) do inc(b);
     if (a/b>p) then begin
          write(b);
          halt(0);
       end else inc(a);
    end;
END.
Re: I need help(WA 17)
Posted by A.Ferdinand 4 May 2006 10:00
Me, too.
I'm getting insane.
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!!!!!!!!!!
Re: I need help(WA 17)
Posted by Burunduk1 4 May 2006 21:06
Use epsilon!
Instead of >= q and > p
use >= q-eps and > p+eps and you'll get AC.
Good luck! ;)
Re: I need help(WA 17)
Posted by wefgef 4 Jun 2006 19:03
this eps thing sucks :(
Re: I need help(WA 17)
Posted by Roman Atangulov 21 Feb 2007 22:21
???
Burunduk1 wrote 4 May 2006 21:06
Use epsilon!
Instead of >= q and > p
use >= q-eps and > p+eps and you'll get AC.
Good luck! ;)

who can say me, what is epsilon???
how to use it
Re: I need help(WA 17)
Posted by svr 21 Feb 2007 22:24
eps=0.000000001
Re: I need help(WA 17)
Posted by Roman Atangulov 21 Feb 2007 22:44
Thank You!!!
I got AC!!! with eps!
Re: I need help(WA 17)
Posted by R. Dubinin 15 Aug 2013 20:42
thanks