比赛 20110923 评测结果 AAAAAA
题目名称 跳远 最终得分 100
用户昵称 wo shi 刘畅 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2011-09-23 21:51:21
显示代码纯文本
var
  long,high,s,c,v0:double;
  i,j,k,n,now:longint;
  yes:boolean;
  a:array[0..1000] of longint;
  x,y:array[0..1000] of double;

begin
  assign(input,'jump.in'); reset(input);
  assign(output,'jump.out'); rewrite(output);
  readln(n,v0);
  for i:=1 to n do read(a[i]);
  x[1]:=a[1]/2;
  y[1]:=a[1]*sqrt(3)/2;
  for i:=2 to n do
  begin
    x[i]:=x[i-1]+a[i-1]/2+a[i]/2;
    y[i]:=a[i]*sqrt(3)/2;
  end;
  for i:=1 to n-1 do
  begin
    now:=0;
    for j:=i+1 to n do
    begin
      long:=x[j]-x[i]; high:=y[j]-y[i];
      if long<high then break;
      c:=sqrt(5*long*long/(long-high));
      if c>v0 then break;
      yes:=true;
      for k:=i+1 to j-1 do
      begin
        s:=(x[k]-x[i])/c;
        if (c*s-5*s*s)<(y[k]-y[i]) then
        begin
          yes:=false;
          break;
        end;
      end;
      if yes then now:=j else break;
    end;
    write(now,' ');
  end;
  close(input);
  close(output);
end.