记录编号 |
7867 |
评测结果 |
AAAAAAAAAAAAAAAAAAAA |
题目名称 |
沙漠赛道 |
最终得分 |
100 |
用户昵称 |
thegy |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.993 s |
提交时间 |
2008-11-11 22:34:35 |
内存使用 |
0.11 MiB |
显示代码纯文本
program mirage;
var
p,soundzp,sounddp:real;
zcp,dcp:real;
pingp,zp,dp:real;
fin,fout:text;
a:real; b:integer;
n,i,ii:longint;
cj,jhpj:real;
tot,tot_z,tot_d:real;
profit_z,profit_d,profit_ping,kc:real;
begin
assign(fin,'mirage.in'); reset(fin);
assign(fout,'mirage.out'); rewrite(fout);
soundzp:=1;
for i:=1 to 4 do begin
read(fin,p);
soundzp:=soundzp*(1-p);
end;
sounddp:=1;
for i:=1 to 4 do begin
read(fin,p);
sounddp:=sounddp*(1-p);
end;
read(fin,zcp); read(fin,dcp);
zcp:=zcp/(zcp+dcp); dcp:=1-zcp;
pingp:=(1-soundzp)*(1-sounddp);
zp:=soundzp*(1-sounddp)+soundzp*sounddp*zcp;
dp:=sounddp*(1-soundzp)+soundzp*sounddp*dcp;
writeln(fout,zp:0:2,' ',dp:0:2,' ',pingp:0:2);
//*******************************************************
read(fin,n);
jhpj:=1; tot_z:=0; tot_d:=0; tot:=0;
for i:=1 to n do begin
read(fin,a,b);
if b=0 then begin
tot_z:=tot_z+a;
end else tot_d:=tot_d+a;
jhpj:=exp((1/n)*ln(a))*jhpj;
tot:=tot+a;
end;
profit_z:=tot-tot_z*2;
profit_d:=tot-tot_d*2;
profit_ping:=tot-jhpj*n;
kc:=profit_z*zp+profit_d*dp+profit_ping*pingp;
writeln(fout,kc:0:2);
close(fin);
close(fout);
end.