比赛 NOIP2008集训模拟2 评测结果 RRRRRRRRRRRRRRRRRRRR
题目名称 沙漠赛道 最终得分 0
用户昵称 WaterFire 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2008-11-11 11:40:54
显示代码纯文本
program waterfire;
const
fin='mirage.in';
fout='mirge.out';
var
a,b:array[1..4] of real;
p1,p2,p3:real;
d1,d2:longint;{动力}
c1,c2,c,k1,k2,s1,s2,s3,ss,num:real;
n,i,j:longint;
f,g:text;
data:array[0..100000] of real;
team:array[0..100000] of longint;
Procedure vl;
var
ii,jj:longint;
Begin
for ii:=1 to 4 do
begin
k1:=k1*(1-a[ii]);
k2:=k2*(1-b[ii]);
end;
p3:=(1-k1)*(1-k2);
p1:=k1*(1-k2);
p2:=k2*(1-k1);
p1:=p1+k1*k2*(d1/(d1+d2));
p2:=p2+k1*k2*(d2/(d1+d2));
End;

Procedure mo;
var
ii,jj:longint;
Begin
s1:=c-c1*2;
s2:=c-c2*2;
num:=1;
for ii:=1 to n do
num:=exp((1/n)*ln(data[ii]))*num;
s3:=c-num*10;
num:=s1*p1+s2*p2+s3*p3;
End;

BEGIN
p1:=0;p2:=0;p3:=0;k1:=1;k2:=1;
assign(f,fin);reset(f);
assign(g,fout);rewrite(g);
for i:=1 to 4 do
read(f,a[i]);
readln(f);
for i:=1 to 4 do
read(f,b[i]);
readln(f);
readln(f,d1,d2);
readln(f,n);
for i:=1 to n do begin
readln(f,data[i],team[i]);
c:=c+data[i];
if team[i]=0 then  c1:=c1+data[i] else c2:=c2+data[i];
end;
vl;
mo;
writeln(g,p1:0:2,' ',p2:0:2,' ',p3:0:2);
writeln(g,num:0:2);
close(f);close(g);
END.