比赛 20110923 评测结果 C
题目名称 跳远 最终得分 0
用户昵称 Launcher 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2011-09-23 20:57:23
显示代码纯文本
program jump;
var
 a:array[1..11]of integer;
 h:array[1..11]of real;
 i,j,k,m,n,v:integer;
 x,y,z:real;
 procedure jump(x0,y0,z0:real;m:integer);
 var x,y,t,z:real;i,j:integer;
 begin
   k:=0;
   while k=0 do
    begin

      t:=t+0.1;
      x:=x0+v*t;
      y:=y0+v*t-5*t*t;
      z:=z0;

      for i:=m+1 to n do
       begin
        z:=z+a[i]/2;
        writeln(y,' ',h[i+1]);
        if (x>=z)and(y<h[i]) then begin write(0,' ');k:=1; break; end;

        if (x>=z)and(y<h[i+1]) then
          begin write(i-1,' ');k:=1;break; end;

       end;
    end;
 end;
begin
 assign(input,'jump.in');
 reset(input);
 assign(output,'jump.out');
 rewrite(output);
 readln(n,v);
 for i:=1 to n do
  begin

    read(k);
    a[i]:=k;
    h[i]:=k*sqrt(3)/2;
  end;
 z:=0;
 k:=0;
 for i:=1 to n-1 do
  begin
    y:=h[i];
    x:=z+a[i]/2;
    jump(x,y,z+a[i],i);
    z:=z+a[i];
  end;
{ close(input);
 close(output);}
end.