比赛 NOIP2008集训模拟2 评测结果 AAAAAAAAAAEEEEEEEEEE
题目名称 沙漠赛道 最终得分 50
用户昵称 thegy 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2008-11-11 10:31:01
显示代码纯文本
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);
  cj:=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;
    cj:=cj*a;
    tot:=tot+a;
  end;
  profit_z:=tot-tot_z*2;
  profit_d:=tot-tot_d*2;
  jhpj:=exp((1/n)*ln(cj));
  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.