测试结果2: 测试结果错误.错误结果为:763007586.92000
正确结果应为:782282631.20000
测试结果3: 测试结果错误.错误结果为:662029686.67188
正确结果应为:993369794.84375
测试结果4: 通过本测试点|有效耗时171ms
测试结果5: 通过本测试点|有效耗时172ms
测试结果6: 测试结果错误.错误结果为:3180608885.06763
正确结果应为:3195710195.06763
测试结果7: 测试结果错误.错误结果为:99552383900.69060
正确结果应为:99552383900.69061
测试结果8: 通过本测试点|有效耗时266ms
测试结果9: 通过本测试点|有效耗时265ms
测试结果10: 通过本测试点|有效耗时297ms
除了第7个精度问题……其他的都是怎么回事我完全不能理解了- -
Program p0694;
var
a,w:array[1..100000]of longint;
r:array[1..100000]of double;
t:longint;
p,q:longint;
n,m,i:longint;
k,ans:double;
u:double;
function max(a,b:longint):longint;
begin if a>b then exit(a) else exit(b); end;
procedure push(x:double;k:longint);
var
l,rk,mid:longint;
begin
if x>=r[p] then begin r[p]:=x; q:=p; w[p]:=k; exit; end;
if x<=r[q] then begin inc(q); r[q]:=x; w[q]:=k; exit; end;
l:=p;
rk:=q;
mid:=(l+rk) div 2;
while not((x<=r[mid])and(x>=r[mid+1])) do
begin
if x>r[mid] then rk:=mid;
if x<r[mid] then l:=mid;
mid:=(l+rk) div 2;
end;
if x=r[mid] then q:=mid else
begin
q:=mid+1;
r[q]:=x;
end;
w[q]:=k;
end;
begin
read(n,m);
read(k);
for i:=1 to n do read(a[n+1-i]);
r[1]:=0;
w[1]:=0;
p:=1;q:=1;
for i:=1 to n do
begin
if (i-w[p])=m then inc(p);
u:=r[p]*k+a[i];
push(u,i);
end;
writeln(r[p]:1:5);
end.