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

Needing your help
Posted by SSAU 6 Vyacheslav Dashivets 30 Jan 2007 22:21
Here's my programm which has a wrong answer at test 9:
Var a:qword;
      i:word;
      arr:array[word] of qword;
Begin
  i:=0;
  While not seekeof do begin
    read(arr[i]);
    inc(i);
  end;
  for i:=i-1 downto 0 do
    writeln(sqrt(arr[i]):0:4);
end.

type "word" gives 65536 values, each one takes 6 or more bytes (I don't know how many bytes type "qword" requires) so I count: 65536*6/1024=384, it means this array can cover up to 384 Kb, although the problem gives a limit 256kb. So everything looks fine, but a wrong answer at #9 test.
Please help...
Re: Needing your help
Posted by Roma Labish[Lviv NU] 30 Jan 2007 23:42
Here is your AC Program:
Var a:qword;
i:longint;
arr:array[0..10000000] of extended;
Begin
i:=0;
While not seekeof do begin
read(arr[i]);
inc(i);
end;
for i:=i-1 downto 0 do
writeln(sqrt(arr[i]):0:4);
end.
Needing your help
Posted by SSAU 6 Vyacheslav Dashivets 31 Jan 2007 00:01
Thanks for help!!! I did get AC, but really didn't understand why my program didn't work.

Edited by author 31.01.2007 00:03