比赛 |
20111104 |
评测结果 |
AAAAAAAAAA |
题目名称 |
网球赛 |
最终得分 |
100 |
用户昵称 |
lizhe |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2011-11-04 21:03:03 |
显示代码纯文本
program elimination;
var
i,j,k,n,num,maxn:longint;
max:real;
f:array[0..10,1..1024]of real;
a:array[1..1024,1..1024]of real;
procedure init;
begin
assign(input,'elimination.in');
reset(input);
assign(output,'elimination.out');
rewrite(output);
read(n);
num:=1;
for i:=1 to n do
num:=num*2;
for i:=1 to num do
for j:=1 to num do
begin
read(a[i,j]);
a[i,j]:=a[i,j]/100
end;
for i:=1 to num do
f[0,i]:=1
end;
procedure get(l,r,x:longint);
var
i,j,k,mid:longint;
begin
if x=1 then
begin
f[x,l]:=a[l,r];
f[x,r]:=a[r,l];
exit
end;
mid:=(l+r)shr 1;
get(l,mid,x-1);
get(mid+1,r,x-1);
for i:=l to mid do
for j:=mid +1 to r do
f[x,i]:=f[x,i]+f[x-1,i]*f[x-1,j]*a[i,j];
for i:=mid+1 to r do
for j:=l to mid do
f[x,i]:=f[x,i]+f[x-1,i]*f[x-1,j]*a[i,j]
end;
procedure print;
begin
for i:=1 to num do
if max<f[n,i] then
begin
max:=f[n,i];
maxn:=i
end;
writeln(maxn);
close(input);
close(output)
end;
begin
init;
get(1,num,n);
print
end.