记录编号 48709 评测结果 AAAAAAAAAAAA
题目名称 H 指数因子 最终得分 100
用户昵称 Gravatar乔治文 是否通过 通过
代码语言 Pascal 运行时间 0.086 s
提交时间 2012-11-06 14:19:19 内存使用 0.46 MiB
显示代码纯文本
var i,j,k,n,temp,h,pp,flag:longint;
    mark,t,p,q:array[1..100] of longint;
    s:array[1..1000] of string;
    a,b:array[1..100] of string;
    temp1:string;
begin
assign(input,'publish.in');
reset(input);
assign(output,'publish.out');
rewrite(output);
readln(n);
for i:=1 to n do
 begin
  readln(a[i]);
  s[i]:=a[i];
 end;
for i:=1 to n do
 begin
  readln(b[i]);
  for j:=1 to n do
   if (b[i,j]='1')
    then inc(t[j]);
 end;
for i:=1 to n do
 begin
  for j:=0 to 100 do
   begin
    h:=0;
    for k:=1 to n do
     if (a[k]=a[i])and(t[k]>=j)
      then inc(h);
    if (h>=j)
     then p[i]:=j;
   end;
 end;

for i:=1 to n do
 for j:=i+1 to n do
  if (p[i]<p[j])or((p[i]=p[j])and(a[i]>a[j]))
   then begin
         temp:=p[i];
         p[i]:=p[j];
         p[j]:=temp;
         temp1:=a[i];
         a[i]:=a[j];
         a[j]:=temp1;
        end;
pp:=0;
for i:=1 to n do
 begin
  flag:=0;
  for j:=1 to i-1 do
   if a[i]=a[j]
    then begin
          flag:=1;
          q[i]:=q[j];
          break;
         end;
  if flag=0
    then begin
          inc(pp);
          q[i]:=pp;
         end;
 end;
fillchar(mark,sizeof(mark),0);
for  i:=1 to n do
 if mark[q[i]]<>1
  then begin
        writeln(a[i],' ',p[i]);
        mark[q[i]]:=1;
       end;
close(input);
close(output);
end.