比赛 NOIP2008集训模拟2 评测结果 AWWWWWWWWWEEEEEEEEEE
题目名称 沙漠赛道 最终得分 5
用户昵称 maxiem 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2008-11-11 10:02:17
显示代码纯文本
program mirage;
var
  crush:array [1..2,1..4] of real;
  sum:array [1..2] of real;
  engine:array [1..3] of integer;
  t:array [1..3] of extended;
  team,i,j,n:longint;
  s3,e,s1,s2,c,a:extended;
begin
  t[1]:=0;t[2]:=0;
  assign (input,'mirage.in');
  reset (input);
  for i:=1 to 2 do begin
    for j:=1 to 4 do read (crush[i,j]);
    readln;
  end;
  readln (engine[1],engine[2]);
  engine[3]:=engine[1]+engine[2];
  readln (n);a:=1;
  for i:=1 to n do begin
    readln (c,team);
    inc(team);
    t[team]:=t[team]+c;
    a:=a*c;
  end;
  t[3]:=t[1]+t[2];
  t[1]:=t[3]-2*t[1];
  t[2]:=t[3]-2*t[2];
  t[3]:=t[3]-exp(ln(a)*(1/n))*10;
  assign (output,'mirage.out');
  rewrite (output);
  sum[1]:=1;sum[2]:=1;
  for i:=1 to 2 do for j:=1 to 4 do sum[i]:=sum[i]*(1-crush[i,j]);
  s1:=sum[1]*sum[2]*(engine[1]/engine[3])+(1-sum[2])*sum[1];
  s2:=sum[1]*sum[2]*(engine[2]/engine[3])+(1-sum[1])*sum[2];
  s3:=(1-sum[1])*(1-sum[2]);
  e:=t[1]*s1+t[2]*s2+t[3]*s3;
  close (input);
  write (s1:0:2);
  write (' ');
  write (s2:0:2);
  write (' ');
  writeln (s3:0:2);
  writeln (e:0:2);
  close (output);
end.