记录编号 |
7734 |
评测结果 |
AAAAAAAAAAAAAAAAAAAA |
题目名称 |
沙漠赛道 |
最终得分 |
100 |
用户昵称 |
chengyang |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.861 s |
提交时间 |
2008-11-11 14:49:42 |
内存使用 |
1.64 MiB |
显示代码纯文本
program mirage;
var
a:array[1..100000,1..2]of real;
sg:array[1..4,1..2]of real;
n,dj,zr:longint;
pj,zr1,dj1,zr2,dj2,zr3,dj3,zrz,djz,zz,qw,zrw,djw:real;
procedure ini;
var
i:longint;
j:real;
Begin
assign(input,'mirage.in');
assign(output,'mirage.out');
reset(input); rewrite(output);
readln(sg[1,1],sg[2,1],sg[3,1],sg[4,1]);
readln(sg[1,2],sg[2,2],sg[3,2],sg[4,2]);
readln(zr2,dj2);
readln(n);
for i:=1 to n do readln(a[i,1],a[i,2]);
zr1:=(1-sg[1,1])*(1-sg[2,1])*(1-sg[3,1])*(1-sg[4,1]);
dj1:=(1-sg[1,2])*(1-sg[2,2])*(1-sg[3,2])*(1-sg[4,2]);
pj:=(1-zr1)*(1-dj1);
j:=zr2+dj2;
zr2:=zr2/j; dj2:=dj2/j;
zrw:=zr1*(1-dj1)+dj1*zr1*zr2;
djw:=dj1*(1-zr1)+zr1*dj1*dj2;
djz:=0; zrz:=0; zz:=0;
for i:=1 to n do begin
zz:=zz+a[i,1];
if a[i,2]=0 then zrz:=zrz+a[i,1]
else djz:=djz+a[i,1];
end;
End;
procedure go;
var
i:longint;
pl:real;
Begin
pl:=1;
for i:=1 to n do pl:=pl*(exp(ln(a[i,1])/n));
qw:=(zz-djz*2)*djw+(zz-zrz*2)*zrw+(zz-pl*n)*pj;
writeln(zrw:0:2,' ',djw:0:2,' ',pj:0:2);
writeln(qw:0:2);
close(input); close(output);
End;
Begin
ini;
go;
End.