记录编号 |
7845 |
评测结果 |
AAAAAAAAAAAAAAAAAAAA |
题目名称 |
沙漠赛道 |
最终得分 |
100 |
用户昵称 |
zqzas |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
2.373 s |
提交时间 |
2008-11-11 21:12:33 |
内存使用 |
0.24 MiB |
显示代码纯文本
#include <iostream>
#include <cmath>
using namespace std;
int n;
double sspjs,ans,tot,mult,money1,money2,down1,down2,fast1,fast2,win1,win2,tie;
void run()
{
tie=down1*down2;
win1=(1-down1)*down2+(1-down1)*(1-down2)*fast1;
win2=down1*(1-down2)+(1-down1)*(1-down2)*fast2;
//the money 1 Win get
ans=0;
ans+=(tot-(money1)*2)*win1;
//the money 2 Win get
ans+=(tot-(money2)*2)*win2;
//the money Tie get
ans+=(tot-n*sspjs/*pow(mult,1/(double)n)*/)*tie;
}
void ini()
{
int i,st,p,q;
double a;
down1=1;
for (i=0;i<4;i++)
{
cin>>a;
down1*=1-a;
}
down1=1-down1;
down2=1;
for (i=0;i<4;i++)
{
cin>>a;
down2*=1-a;
}
down2=1-down2;
cin>>p>>q;
fast1=p/( (double)(p+q) );
fast2=q/( (double)(p+q) );
cin>>n;
mult=1;
sspjs=1;
for (i=0;i<n;i++)
{
cin>>a>>st;
sspjs*=pow(a,1/(double)n);
if (st==0)
{
money1+=a;
}
else
money2+=a;
}
tot=money1+money2;
}
int main()
{
freopen("mirage.in","r",stdin);
freopen("mirage.out","w",stdout);
ini();
run();
printf("%.2lf %.2lf %.2lf\n",win1,win2,tie);
printf("%.2lf",ans);
return 0;
}