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 1001. Reverse Root

Why wrong answer?
Posted by Vladzick 23 Nov 2007 19:13
{N$+}
var a:array[1..1000]of extended;
    b:array[1..1000]of extended;
    l,m,n:extended;
    i,k:integer;
    f1,f2:text;
begin
    assign(f1,'input.txt');
    assign(f2,'output.txt');
    reset(f1); rewrite(f2);
    while not eof(f1) do begin
    read(f1,l);
    i:=i+1;
    a[i]:=l;
    end;
    for k:=1 to i do begin
    b[k]:=sqrt(a[k]);
    end;
    for k:=i downto 1 do
    writeln(f2,b[k]:0:4);
    close(f1); close(f2);
end.
I don't believe...That works right on my computer but WA1!!!
Re: Why wrong answer?
Posted by KIRILL(ArcSTUpid coder:) 23 Nov 2007 21:58
see faq
-don't use i/o files
-use seekeof for numbers
-arrays [1000] is not enough
Re: Why wrong answer?
Posted by Vladzick 25 Jan 2008 17:28
Thank's a lot