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 1047. Simple Calculations

why i got wa???
Posted by geniushjs 6 Aug 2003 07:51
this is my program:
program df(input,output);
var
ai:array[1..3000] of integer;
aj:array[1..3000] of real;
c:array[1..3000] of real;
i,j,n,m,k:integer;
a0,an1,a1,d:real;
procedure p(i,k:integer;d:real);
begin
 if i=n+2 then begin a1:=(an1-d)/k; writeln(a1:4:2); end
 else
  begin
   ai[i]:=2*k-ai[i-2]; k:=ai[i];
   aj[i]:=2*d+2*c[i-1]-aj[i-2]; d:=aj[i];
   p(i+1,k,d);
  end;
end;
begin
 readln(n);
 readln(a0);
 readln(an1);
 for i:=1 to n do readln(c[i]);
 if n=0 then begin writeln(an1:4:2); halt; end;
 if n=1 then begin writeln(((a0+an1)/2-c[1]):4:2); halt; end;
 k:=2;d:=2*c[1]-a0;
 ai[1]:=1; aj[1]:=0;
 p(3,k,d);
end.
why i got wa???
Test (+)
Posted by Renat Mullakhanov 7 Aug 2003 11:25
3
0
4
0
0
0

answer=1
-----
The sequence is: 0 1 2 3 4
thanks>>
Posted by geniushjs 12 Aug 2003 10:05
thank you very much.(by geniushjs)this is my E-mail:geniushjs@tom.com