比赛 NOIP2008集训模拟2 评测结果 WWWWWWWWWWEEEEEEEEEE
题目名称 沙漠赛道 最终得分 0
用户昵称 elysian 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2008-11-11 11:29:24
显示代码纯文本
program elysian;
const
fin='mirage.in';fout='mirage.out';
var
g1,g2,v1,v2,p1,p2,all,zhu1,zhu2,allc,l1,l2,l3,e,x,y,z:real;
f1,f2:text;
n:longint;


procedure print1;
begin
x:=g1*(1-g2)+g1*g2*p1;
y:=g2*(1-g1)+g1*g2*p2;
z:=(1-g1)*(1-g2);
x:=round(x*100)/100;
y:=round(y*100)/100;
z:=round(z*100)/100;
writeln(f2,x,' ',y,' ',z)
end;

procedure init;
var
t1,t2,t3,t4:real;
i,j:longint;
begin
assign(f1,fin);reset(f1);
readln(f1,t1,t2,t3,t4);
assign(f2,fout);rewrite(f2);
g1:=(1-t1)*(1-t2)*(1-t3)*(1-t4);
readln(f1,t1,t2,t3,t4);
g2:=(1-t1)*(1-t2)*(1-t3)*(1-t4);
readln(f1,t1,t2);
p1:=t1/(t1+t2);
p2:=t2/(t1+t2);
readln(f1,n);
allc:=1;
for i:=1 to n do
begin
readln(f1,t1,t2);
if t2=0 then zhu1:=zhu1+t1;
if t2=1 then zhu2:=zhu2+t1;
all:=all+t1;
allc:=allc*t1;
end;
close(f1);
print1;
end;

procedure main;
var
jp,a:real;
begin
l1:=all-2*zhu1;
l2:=all-2*zhu2;
jp:=exp((1/n)*ln(allc));
l3:=all-2*jp;
e:=x*l1+y*l2+z*l3;
writeln(f2,e:0:2);

end;

begin
init;
main;
close(f2);
end.