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 1258. Pool

I think this problem is simple but I got WA#14
Posted by Saturn 2 Jul 2004 23:22
I think this problem is simple but I got WA#14.

var w,d:real;
    l:real;
    lx,ly,x0,y0,x1,y1:real;
    ch:char;
begin
        readln(w,d);
        readln(x0,y0);
        readln(x1,y1);
        lx:=x0-x1;
        ly:=y0-y1;
        while not eof do
        begin
                read(ch);
                case upcase(ch) of
                'L':lx:=lx+2*x1;
                'R':lx:=lx+2*(w-x1);
                'F':ly:=ly+2*y1;
                'B':ly:=ly+2*(d-y1);
                end;
        end;
        l:=sqrt(lx*lx+ly*ly);
        write(l:0:4);
end.
Re: I think this problem is simple but I got WA#14
Posted by Saturn 8 Jul 2004 00:07
Oh AC now! Very stupid bug:)