比赛 NOIP2008集训模拟2 评测结果 AAAAAAAAAAAAAAAAAAAA
题目名称 沙漠赛道 最终得分 100
用户昵称 辨机ZN 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2008-11-11 10:22:42
显示代码纯文本
program mirage(f1,f2);
 type
  zn=array [1..100001] of real;
  ka=array [1..4] of real;
  ma=record
   qian:real;
   num:longint;
  end;
  fa=array [1..100001] of ma;
 var
  b,c,d:zn; f1,f2:text; a:fa;
  i,j,k,p,m,n:longint; gz1,gz2:ka; y1,y2,s1,s2,z1,z2,ans1,ans2,ans3:real;
  gl,gl1,gl2:real; v1,v2:longint; tot1,tot2,l1,l2,l3,fin:real;
 begin
  assign(f1,'mirage.in'); reset(f1);
  assign(f2,'mirage.out'); rewrite(f2);
  for i:=1 to 4 do read(f1,gz1[i]); readln(f1);
  for i:=1 to 4 do read(f1,gz2[i]); readln(f1);
  readln(f1,v1,v2);
  readln(f1,n);
  y1:=1; y2:=1; s1:=0; s2:=0;
  for i:=1 to n do readln(f1,a[i].qian,a[i].num);
  for i:=1 to 4 do y1:=y1*(1-gz1[i]);
  for i:=1 to 4 do y2:=y2*(1-gz2[i]);
  s1:=1-y1; s2:=1-y2;
  z1:=v1/(v1+v2);
  z2:=v2/(v1+v2);
  ans1:=y1*s2+y1*y2*z1;
  ans2:=y2*s1+y1*y2*z2;
  ans3:=1-ans1-ans2;
  for i:=1 to n do if a[i].num=0 then tot1:=tot1+a[i].qian
                                 else tot2:=tot2+a[i].qian;
  writeln(f2,ans1:0:2,' ',ans2:0:2,' ',ans3:0:2);
  l1:=tot1+tot2-2*tot1;
  l2:=tot1+tot2-2*tot2;
  l3:=1;
  for i:=1 to n do l3:=exp(ln(a[i].qian)/n)*l3;
  l3:=tot1+tot2-l3*n;
  fin:=ans1*l1+ans2*l2+ans3*l3;
  writeln(f2,fin:0:2);
  close(f1);
  close(f2);
 end.