比赛 20121106 评测结果 AAAAAAAAAAAA
题目名称 H 指数因子 最终得分 100
用户昵称 joeyolui 运行时间 0.007 s
代码语言 Pascal 内存使用 0.23 MiB
提交时间 2012-11-06 10:56:13
显示代码纯文本
type
data=record
 name:string;
 papernum:integer;
 paper:array[1..100] of integer;
 zhishu:integer;
 end;
var
a:array[1..101] of data;
b:array[1..100] of string;
c:array[1..100] of integer;
i,n,j,zjs,tempn,h,k:integer;
temps:string;
tempch:char;

begin
assign(input,'publish.in'); assign(output,'publish.out');
reset(input); rewrite(output);
readln(n);
for i:=1 to n do
 readln(b[i]);
for i:=1 to n do
 begin
 j:=1;
 while j<=n do
  begin
  read(tempch);
  if (tempch='0') or (tempch='1') then begin c[j]:=c[j]+ord(tempch)-48; inc(j) end;
  end;
 end;
for i:=1 to n do
 for j:=1 to 100 do
  with a[j] do
  begin
  if name='' then begin name:=b[i]; inc(papernum); inc(zjs); paper[papernum]:=c[i]; break end else
  if b[i]=name then begin inc(papernum); paper[papernum]:=c[i]; break; end;
  end;
for i:=1 to zjs do
 begin
 h:=1;
 j:=1;
 while j>=h do
  begin
  j:=0;
  for k:=1 to a[i].papernum do
   if a[i].paper[k]>=h then inc(j);
  if j>=h then inc(h);
  end;
 a[i].zhishu:=h-1;
 end;
for i:=1 to zjs do
 for j:=i+1 to zjs do
  if a[i].zhishu<a[j].zhishu then begin a[101]:=a[i]; a[i]:=a[j]; a[j]:=a[101]; end else
  if a[i].zhishu=a[j].zhishu then
   if a[i].name>a[j].name then begin a[101]:=a[i]; a[i]:=a[j]; a[j]:=a[101]; end;
for i:=1 to zjs do
 writeln(a[i].name,' ',a[i].zhishu);
end.