比赛 |
20111104 |
评测结果 |
AAAAAAAWWW |
题目名称 |
网球赛 |
最终得分 |
70 |
用户昵称 |
reamb |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2011-11-04 21:52:34 |
显示代码纯文本
program wangqiusai;
var
f:array[0..10,1..1100]of real;
bz:array[0..10,1..1100,1..1100]of boolean;
t,i,j,k,l,n,now,ans:longint;
a:array[1..1100,1..1100]of real;
max:real;
function cifang(j:longint):longint;
var
b,i:longint;
begin
b:=1;
for i:=1 to j do
b:=b*2;
exit(b)
end;
begin
assign (input,'elimination.in');
reset (input);
assign (output,'elimination.out');
rewrite (output);
readln (n);
t:=cifang(n);
for i:=1 to t do
begin
for j:=1 to t do
begin
read (a[i,j]);
a[i,j]:=a[i,j]/100
end;
readln
end;
for i:=0 to n do
for j:=1 to t do
for k:=1 to t do
bz[i,j,k]:=false;
for i:=1 to n do
begin
now:=cifang(i);
l:=0;
repeat
for j:=l+1 to l+now do
for k:=l+1 to l+now do
if bz[i-1,j,k] then
bz[i,j,k]:=false
else
bz[i,j,k]:=true;
l:=l+now
until l=t
end;
for i:=1 to t do
f[0,i]:=1;
for i:=1 to n do
for j:=1 to t do
for k:=1 to t do
if (j<>k)and(bz[i,j,k]) then
f[i,j]:=f[i,j]+f[i-1,j]*f[i-1,k]*a[j,k];
max:=0;
for i:=1 to t do
begin
if f[n,i]>max then
begin
ans:=i;
max:=f[n,i]
end
end;
writeln (ans);
close (input);
close (output)
end.