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 1351. Good Gnusmas – Dead Gnusmas

WA#1 ! Please help, I can't understand it ??
Posted by FireHeart 19 Jul 2008 17:47
Here is my code :
Const fi='input.txt';
      fo='output.txt';
Var Range,a1,b1,a2,b2,x,y,x1,y1,x2,y2:real;
    n,i,j:integer;
    f,g:text;
{------------------------------------------------------------------------}
Begin
  Assign(f,fi); Reset(f);
  Assign(g,fo); Rewrite(g);

  Readln(f,Range,x1,y1,x2,y2);
  a1:=y1; a2:=y2; b1:=x1*(-1); b2:=x2*(-1);
  Readln(f,n);
  for i:=1 to n do
    Begin
      Readln(f,x,y);
      if (sqrt(x*x + y*y)<=Range) then
      if (x1<>x2) or (y1<>y2) then
        begin
        if ((x*a1+y*b1)*(x2*a1+y2*b1)>=0) and
                 ((x*a2+y*b2)*(x1*a2+y1*b2)>=0) then
          Begin
            Writeln(g,'YES');
            Continue;
          End;
        End
      else if (x1=x2) and (y1=y2) then
        if (x*a1+y*b1)=0 then
          Begin
            Writeln(g,'YES');
            Continue;
          ENd;

      Writeln(g,'NO');
    End;

  Close(f);
  Close(g);
End.
Re: WA#1 ! Please help, I can't understand it ??
Posted by →MOPDOBOPOT← 7 May 2009 17:44
-Nothing-


Edited by author 07.05.2009 17:45
Re: WA#1 ! Please help, I can't understand it ??
Posted by Sergey Lazarev (MSU TB) 7 May 2009 23:04
Read FAQ! You must use standart Input/Output, not files.