比赛 |
20111104 |
评测结果 |
C |
题目名称 |
网球赛 |
最终得分 |
0 |
用户昵称 |
feng |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2011-11-04 20:49:33 |
显示代码纯文本
program lx;
const
filename='elimination';
inf=filename+'.in';
ouf=filename+'.out';
maxn=1024;
var
i,j,k,l,m,n,x,p,y:longint;
sum:real;
a,f:array[0..maxn,0..maxn]of real;
function xy(x:longint):longint;
var i:longint;
begin
xy:=1;
for i:=1 to x do
xy:=xy*2;
end;
begin
assign(input,inf); reset(input);
assign(output,ouf);rewrite(output);
readln(m);
fillchar(f,sizeof(f),0);
fillchar(a,sizeof(a),0);
n:=1;
for i:=1 to m do
n:=2*n;
for i:=1 to n do
for j:=1 to n do
begin
read(a[i,j]);
a[i,j]:=a[i,j]/100;
end;
for i:=1 to n do
f[0,i]:=1;
for i:=1 to m do
for j:=1 to n do
begin
x:=xy(i-1);
p:=(j-1)div x;
if p mod 2=0 then
y:=x
else y:=-x;
for k:=(p*x+y+1) to (p*x+y+x) do
f[i,j]:=f[i-1,j]*f[i-1,k]*a[j,k]+f[i,j];
end;
sum:=0;
for i:=1 to n do
if f[m,i]>sum then begin
sum:=f[m,i];
j:=i;
end;
writeln(j);
close(input);close(output);
end.