比赛 20110923 评测结果 AAAAAA
题目名称 跳远 最终得分 100
用户昵称 Des. 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2011-09-23 20:07:33
显示代码纯文本
program jump;
var x,y,a:array[0..10]of real;
    k,m,n,i,j,ans:longint;
    max,min,s,r,t,v0,v:real;
    p:boolean;
const g=10;
begin
assign(input,'jump.in');
reset(input);
assign(output,'jump.out');
rewrite(output);
readln(n,v0);
for k:=1 to n do
  begin
    read(a[k]);
    x[k]:=x[k-1]+(a[k-1]+a[k])/2;
    y[k]:=sqrt(3)/2*a[k];
  end;
for i:=1 to n-1 do
  begin
    ans:=0;
    for j:=1 to i-1 do
      if ((((x[i]-x[j])-(y[j]-y[i]))/5)>=0)and (sqrt(((x[i]-x[j])-(y[j]-y[i]))/5)>=(x[i]-x[j])/v0) then
        begin
          p:=true;
          t:=sqrt(((x[i]-x[j])-(y[j]-y[i]))/5);
          v:=(x[i]-x[j])/t;
          for k:=j+1 to i-1 do
            if (x[i]-x[k])-1/2*g*sqr((x[i]-x[k])/v)<=y[k]-y[i] then
              p:=false;
          if p then ans:=j
          else break;
        end;
    for j:=i+1 to n do
      if  ((((x[j]-x[i])-(y[j]-y[i]))/5)>=0)and (sqrt(((x[j]-x[i])-(y[j]-y[i]))/5)>=(x[j]-x[i])/v0) then
        begin
          p:=true;
          t:=sqrt(((x[j]-x[i])-(y[j]-y[i]))/5);
          v:=(x[j]-x[i])/t;
          for k:=i+1 to j-1 do
            if (x[k]-x[i])-1/2*g*sqr((x[k]-x[i])/v)<=(y[k]-y[i]) then
              p:=false;
        if p then ans:=j
        else break;
        end;
    write(ans,' ');
  end;
close(output);
end.