比赛 20090927练习赛 评测结果 WAAWWA
题目名称 跳远 最终得分 50
用户昵称 reamb 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2009-09-27 21:47:59
显示代码纯文本
program tiaoyuan;
var
  n,v0,i,j,biaozhi:integer;
  t:real;
  a:array[1..100,1..2]of real;
  bc,jilu:array[1..100]of integer;
begin
  assign (input,'jump.in');
  reset (input);
  assign (output,'jump.out');
  rewrite (output);
  readln (n,v0);
  for i:=1 to n do
    read (bc[i]);
  a[1,1]:=0;
  a[1,2]:=sqrt(3)*(bc[1]/2);
  for i:=2 to n do
  begin
    a[i,1]:=a[i-1,1]+(bc[i-1]+bc[i])/2;
    a[i,2]:=sqrt(3)*(bc[i]/2)
  end;
  for i:=1 to n-1 do
  begin
    biaozhi:=0;
    for j:=i+1 to n do
    begin
      t:=(a[j,1]-a[i,1])/v0;
      if (a[i,2]+v0*t-5*t*t)>=a[j,2] then
      begin
        jilu[i]:=j;
        biaozhi:=1
      end
      else
      begin
        if biaozhi=0 then
        jilu[i]:=-1;
        break
      end
    end
  end;
  for i:=1 to n-1 do
  if jilu[i]>0 then
    write (jilu[i],' ');
  close (input);
  close (output)
end.