比赛 20091110 评测结果 WWWWWWWWWW
题目名称 股票收益 最终得分 0
用户昵称 ReimBurSe. 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2009-11-10 09:12:05
显示代码纯文本
Program stock;

Type
sc=array [1..1000] of real;

Var
s:sc;
i,j,n:longint;
m:longint;
max:real;
l,v:real;
z,b,w:longint;

Begin
assign(input,'stock.in');
assign(output,'stock.out');
reset(input);
rewrite(output);
readln(n);
l:=0;
v:=0;
for i:=1 to n do read(s[i]);
readln;
readln(m);
for i:=1 to n do
 for j:=i+1 to n do
  if s[j]-s[i]>max then max:=s[j]-s[i];
l:=max*m;
z:=0;
b:=0;
w:=0;
for i:=1 to n do begin
 for j:=i+1 to n do begin
  if s[j]>s[i] then z:=z+1;
  if s[j]<s[i] then b:=b+1;
  if s[j]=s[i] then w:=w+1;
 end;
end;
if (z+b+w)<>0 then v:=z/(z+b+w);
writeln(l:0:3);
writeln(v:0:3);
close(input);
close(output);
End.