比赛 |
20121106 |
评测结果 |
WWWWWWWWWWWW |
题目名称 |
H 指数因子 |
最终得分 |
0 |
用户昵称 |
digital-T |
运行时间 |
0.005 s |
代码语言 |
Pascal |
内存使用 |
0.23 MiB |
提交时间 |
2012-11-06 11:49:45 |
显示代码纯文本
var
w:boolean;
au,st:array[1..100]of string;
g,num,outh:array[1..100]of integer;
hh:array[1..100,1..100]of integer;
n,i,j,k,h,h1,h2,max,people:integer;
begin
assign(input,'publish.in');reset(input);
assign(output,'publish.out');rewrite(output);
fillchar(g,sizeof(g),false);
readln(n);people:=n;
k:=0;
for i:=1 to n do begin g[i]:=i;num[i]:=1;end;
for i:=1 to n do
begin
readln(au[i]);
for j:=1 to i-1 do if au[i]=au[j] then begin g[i]:=j;inc(num[j]);dec(people);break;end;
end;
for i:=1 to n-1 do readln(st[i]);
read(st[n]);
for i:=1 to n do if num[i]>max then max:=num[i];
//________________________________
for i:=1 to n do//author
if g[i]=i then
for j:=1 to n do//essay
if g[j]=i then
for k:=1 to n do
if (k<>j)and(st[k][j]='1')then inc(hh[i,j]);
//________________________________
for k:=1 to n do//author
if g[k]=k then
for h:=num[k] downto 0 do//h
begin
h1:=0;//higher
h2:=0;//below
for i:=1 to n do//essay
if g[i]=k then
begin if hh[g[i],i]>=h then inc(h1);
if hh[g[i],i]<=h then inc(h2);end;
if (h1=h2)and(h=h1)then begin outh[k]:=h;break;end;
end;
for h:=max downto 0 do
for i:=1 to people do
begin
h1:=1;
w:=false;
for k:=2 to n do
begin
if outh[h1]=h then w:=true;
if (g[k]=k)and(outh[k]=h) then if au[h1]>au[k]then h1:=k;
end;
if w then writeln(au[h1],' ',outh[h1]);
g[h1]:=0;
end;
close(input);close(output);
end.