记录编号 7691 评测结果 AAAAAAAAAAAAAAAAAAAA
题目名称 沙漠赛道 最终得分 100
用户昵称 Gravatarelysian 是否通过 通过
代码语言 Pascal 运行时间 0.886 s
提交时间 2008-11-11 11:46:18 内存使用 0.87 MiB
显示代码纯文本
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;
c:array[1..100000] of real;


procedure print1;
begin
x:=g1*(1-g2)+g1*g2*p1;
y:=g2*(1-g1)+g1*g2*p2;
z:=(1-g1)*(1-g2);
writeln(f2,x:0:2,' ',y:0:2,' ',z:0:2)
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;
c[i]:=t1;
end;
close(f1);
print1;
end;

procedure main;
var
i:longint;
jp,a,t:real;
begin
l1:=all-2*zhu1;
l2:=all-2*zhu2;
jp:=1;
for i:=1 to n do
begin
t:=c[i];
jp:=jp*exp((1/n)*ln(t));
end;
l3:=all-n*jp;
e:=x*l1+y*l2+z*l3;
writeln(f2,e:0:2);

end;

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