比赛 |
10101115 |
评测结果 |
WWWWWWWWWW |
题目名称 |
牛宫 |
最终得分 |
0 |
用户昵称 |
magic |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2010-11-15 10:47:02 |
显示代码纯文本
program gls;
var
m,n,p,pp,ans,i,j:longint;sum,max,maxx:real;
ss:array[1..200]of real;
st:array[1..200]of longint;
data:array[1..200,1..200]of longint;
f,g:text;
begin
assign(f,'long.in');
reset(f);
assign(g,'long.out');
rewrite(g);
readln(f,m,n);
for i:=1 to m do
begin for j:=1 to n do
read(f,data[i,j]);
end;
for i:=1 to m do
begin for j:=1 to n do
ss[i]:=ss[i]+data[i,j];
ss[i]:=ss[i]/n;
st[i]:=n;
end;
for i:=1 to m-1 do
begin sum:=0;sum:=ss[i];p:=st[i];
for j:=i+1 to m do
if sum+ss[j]>0 then begin sum:=sum+ss[j];p:=p+st[j];end;
{ writeln(g,sum);}
max:=sum;pp:=p;
if max>maxx then begin maxx:=max;ans:=pp;end;
end;
{for i:=1 to m do write(g,ss[i]:0:0,' '); }
writeln(g,ans);
close(f);close(g);
end.