比赛 |
20110923 |
评测结果 |
WAAWWA |
题目名称 |
跳远 |
最终得分 |
50 |
用户昵称 |
feng |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2011-09-23 20:58:52 |
显示代码纯文本
program lx;
const
filename='jump';
inf=filename+'.in';
ouf=filename+'.out';
maxn=10;
var
i,j,k,l,n,v,x,y:longint;
m,sum:real;
a:array[0..maxn]of real;
f,s:array[0..maxn]of real;
function fx(i,j:longint):real;
var k,t,x,y,x0,y0:real;
begin
y:=0;
x:=0;
x:=a[j];
x0:=a[i];
t:=(x-x0)/v;
y0:=s[i];
fx:=y0+v*t-5*t*t;
end;
begin
assign(input,inf); reset(input);
assign(output,ouf);rewrite(output);
readln(n,v);
for i:=1 to n do
read(f[i]);
sum:=0;
for i:=1 to n do
begin
s[i]:=f[i]/2*sqrt(3);
sum:=sum+f[i];
a[i]:=sum-f[i]/2;
end;
sum:=0;
for i:=1 to n-1 do
begin
sum:=0;
for j:=i+1 to n do
begin
m:=fx(i,j);
if m-s[j]>0.0000001 then sum:=j
else begin sum:=j-1;break;end;
end;
write(sum:0:0,' ');
end;
close(input);close(output);
end.