记录编号 |
7715 |
评测结果 |
AAAAAAAAAAAAAAAAAAAA |
题目名称 |
沙漠赛道 |
最终得分 |
100 |
用户昵称 |
苏轼 |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.927 s |
提交时间 |
2008-11-11 14:21:54 |
内存使用 |
0.87 MiB |
显示代码纯文本
program cch(input,output);
var
i,x1,x2,n,y:longint;
a1,a2:array[1..4] of real;
ans,l1,l2,tmp1,x,tmp2,p1,p2,p3,k1,k2,k3,c1,w1,w2,tot:real;
data:array[1..100000] of real;
begin
assign(input,'mirage.in');
assign(output,'mirage.out');
reset(input);
rewrite(output);
for i:=1 to 4 do read(a1[i]);
for i:=1 to 4 do read(a2[i]);
readln(x1,x2);
l1:=x1/(x1+x2); l2:=x2/(x1+x2);
readln(n);
for i:=1 to n do
begin
readln(x,y);
data[i]:=x;
if y=0 then w1:=w1+x
else w2:=w2+x;
end;
tmp1:=1; tmp2:=1;
for i:=1 to 4 do tmp1:=tmp1*(1-a1[i]);
for i:=1 to 4 do tmp2:=tmp2*(1-a2[i]);
p1:=tmp1*tmp2*l1+(1-tmp2)*tmp1;
p2:=tmp1*tmp2*l2+(1-tmp1)*tmp2;
p3:=(1-tmp1)*(1-tmp2);
tot:=w1+w2;
k1:=tot-w1*2; k2:=tot-w2*2;
k3:=1;
for i:=1 to n do
k3:=k3*exp(ln(data[i])/n);
k3:=tot-k3*n;
writeln(p1:0:2,' ',p2:0:2,' ',p3:0:2);
ans:=k1*p1+k2*p2+k3*p3;
writeln(ans:0:2);
close(input);
close(output);
end.