记录编号 |
32513 |
评测结果 |
AAAAAAAAAA |
题目名称 |
网球赛 |
最终得分 |
100 |
用户昵称 |
reamb |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.591 s |
提交时间 |
2011-11-07 08:11:17 |
内存使用 |
34.83 MiB |
显示代码纯文本
program wangqiusai;
var
f:array[0..10,1..1100]of real;
bz:array[0..10,1..1100,1..1100]of integer;
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]:=0;
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
bz[i,j,k]:=bz[i-1,j,k]+1;
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]=1) 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.