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

Advices
Posted by Gleb Grenkin 15 Aug 2005 12:27
1) Use SINGLE type in Pascal or correct real compare:

function eq(a, b: float): boolean;
begin
  Result := abs(a-b) <= eps; //eps is calculations accuracy
end;

2) Don't forget that frac(p*x) and frac(q*x) may be 0.
Re: Advices
Posted by Hramov 3 Dec 2005 19:28
i don't understand, why my program do not pass test with real-type and pass with single. i do not use constructions such as real=real.

my code:
{$APPTYPE CONSOLE}
uses
  sysutils;

var a,b:single;
    n:longint;
begin
n:=0;
  readln(a,b);
  while true do
  begin
  inc(n);
  if (trunc(n*a/100)+1<n*b/100)and(trunc(n*b/100)>n*a/100)then begin writeln(n);exit; end;
  end;
end.

anybody know test N3??