比赛 NOIP2008集训模拟2 评测结果 AAAAAAAAAAAAAAAAAAAA
题目名称 沙漠赛道 最终得分 100
用户昵称 苏轼 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2008-11-11 10:10:48
显示代码纯文本
program cch(input,output);
var
 i,x1,x2,n,y:longint;
 a1,a2:array[1..4] of real;
 ans,l1,l2,tmp1,x,tmp2,p1,p2,p3,k1,k2,k3,c1,w1,w2,tot:real;
 data:array[1..100000] of real;
begin
 assign(input,'mirage.in');
 assign(output,'mirage.out');
 reset(input);
 rewrite(output);
 for i:=1 to 4 do read(a1[i]);
 for i:=1 to 4 do read(a2[i]);
 readln(x1,x2);
 l1:=x1/(x1+x2); l2:=x2/(x1+x2);
 readln(n);
 for i:=1 to n do
  begin
   readln(x,y);
   data[i]:=x;
   if y=0 then w1:=w1+x
    else w2:=w2+x;
  end;
 tmp1:=1; tmp2:=1;
 for i:=1 to 4 do tmp1:=tmp1*(1-a1[i]);
 for i:=1 to 4 do tmp2:=tmp2*(1-a2[i]);
 p1:=tmp1*tmp2*l1+(1-tmp2)*tmp1;
 p2:=tmp1*tmp2*l2+(1-tmp1)*tmp2;
 p3:=(1-tmp1)*(1-tmp2);
 tot:=w1+w2;
 k1:=tot-w1*2; k2:=tot-w2*2;
 k3:=1;
 for i:=1 to n do
 k3:=k3*exp(ln(data[i])/n);
 k3:=tot-k3*n;
 writeln(p1:0:2,' ',p2:0:2,' ',p3:0:2);
 ans:=k1*p1+k2*p2+k3*p3;
 writeln(ans:0:2);
 close(input);
 close(output);
end.