比赛 HAOI2009 模拟试题4 评测结果 AAAWWWAWWA
题目名称 K- 联赛 最终得分 50
用户昵称 0彼岸0 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2009-04-24 11:16:06
显示代码纯文本
program kleague;
var a:array[1..25,1..25]of longint;
    u,w,d,ma:array[1..25]of longint;
    sw,sum,i,j,n,m:longint;
    tot:longint;
    cheat:array[1..100]of longint;
begin
 assign(input,'kleague.in');
 assign(output,'kleague.out');
 reset(input);
 rewrite(output);
 read(n);
 fillchar(u,sizeof(u),0);
 for i:=1 to n do
  read(w[i],d[i]);
 sum:=0;
 for i:=1 to n do
  for j:=1 to n do
   begin
   read(a[i,j]);
   inc(u[i],a[i,j]);
   sum:=sum+a[i,j];
   end;
 sum:=sum div 2;
 tot:=0;

 for i:=1 to n do
  begin
   ma[i]:=w[i]+u[i];
   sw:=0;
   for j:=1 to n do
    sw:=sw+w[j];
   sw:=sw-w[i];
   sw:=sw+sum-u[i];
   if sw>ma[i]*(n-1) then continue
                      else
                       begin
                        inc(tot);
                        cheat[tot]:=i;
                       end;
   for j:=1 to n do
    begin
     if j=i then continue;
     if sw div (n-1)<w[i] then
      if w[i]>ma[i] then dec(tot);
    end;
  end;
 for i:=1 to tot-1 do
  write(cheat[i],' ');
 writeln(cheat[tot]);
 close(input);
 close(output);
end.