比赛 |
NOIP2008集训模拟2 |
评测结果 |
AAAAAAAAAAAAAAAAAAAA |
题目名称 |
沙漠赛道 |
最终得分 |
100 |
用户昵称 |
卐祭司卐 |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2008-11-11 10:36:02 |
显示代码纯文本
program mirage;
var
a,b:array[1..4] of real;
ga,gb,ea,eb,p1,p2,zr,dj,h,
z,pj,k,cfg,suba,subb:real;
i,j,n:longint;
fi,fo:text;
begin
assign(fi,'mirage.in');
assign(fo,'mirage.out');
reset(fi);
rewrite(fo);
for i:=1 to 4 do read(fi,a[i]); readln(fi);
for i:=1 to 4 do read(fi,b[i]); readln(fi);
readln(fi,ea,eb);
readln(fi,n);
z:=0;suba:=0;subb:=0; cfg:=1;
for i:=1 to n do
begin
read(fi,k,j);
if j=0 then suba:=suba+k else if j=1 then subb:=subb+k;
cfg:=cfg*exp(ln(k)/n);
z:=z+k;
end;
zr:=z-suba*2;
dj:=z-subb*2;
cfg:=z-cfg*n;
ga:=1;gb:=1;
k:=ea+eb;
ea:=ea/k;eb:=eb/k;
for i:=1 to 4 do begin ga:=ga*(1-a[i]);
gb:=gb*(1-b[i]); end;
pj:=(1-ga)*(1-gb);
p1:=ga*gb*ea+(1-gb)-pj;
p2:=ga*gb*eb+(1-ga)-pj;
h:=zr*p1+dj*p2+cfg*pj;
writeln(fo,p1:0:2,' ',p2:0:2,' ',pj:0:2);
write(fo,h:0:2);
close(fi);
close(fo);
end.