比赛 |
20111104 |
评测结果 |
AAAAAAWWAW |
题目名称 |
网球赛 |
最终得分 |
70 |
用户昵称 |
苏轼 |
运行时间 |
0.000 s |
代码语言 |
C++ |
内存使用 |
0.00 MiB |
提交时间 |
2011-11-04 21:26:28 |
显示代码纯文本
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
int number;
double w[1025][1025];
int q[1025][11];
double a[1025][11];
int f[11]={1,2,4,8,16,32,64,128,256,512,1024};
int main()
{
freopen ("elimination.in","r",stdin);
freopen ("elimination.out","w",stdout);
scanf("%d",&number);
for (int i=1;i<=f[number];i++)
{
for (int j=1;j<=f[number];j++)
{
scanf("%lf",&w[i][j]);
w[i][j]/=100;
}
}
for (int i=1;i<=f[number];i++)
{
a[i][1]=1;
q[i][1]=(double)i;
}
for (int i=1;i<=number;i++)
{
for (int j=1;j<=f[number];j++)
{
if ((q[j][i])%2==1)
{
for (int k=1;k<=f[number];k++)
{
if (q[k][i]>q[j][i]+1)
{
break;
}
if (q[k][i]==q[j][i]+1)
{
a[j][i+1]+=a[j][i]*w[j][k];
}
}
q[j][i+1]=(q[j][i]+1)/2;
}
if ((q[j][i])%2==0)
{
for (int k=j;k>=1;k--)
{
if (q[k][i]<q[j][i]-1)
{
break;
}
if (q[k][i]==q[j][i]-1)
{
a[j][i+1]+=a[j][i]*w[j][k];
}
}
q[j][i+1]=q[j][i]/2;
}
}
}
double max=0;
int answer;
for (int i=1;i<=f[number];i++)
{
if (a[i][number+1]>max)
{
max=a[i][number+1];
answer=i;
}
}
cout<<answer;
return 0;
}