比赛 noip_6 评测结果 AAAAATTTTT
题目名称 词链 最终得分 50
用户昵称 zxc111 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2008-10-08 20:44:09
显示代码纯文本
program ooo;
var
i,j,m,n,k,max:longint;
a,aa:array[0..10002] of string;
t:text;
b,c:array[0..10002] of longint;
begin
assign(t,'link.in');
reset(t);
readln(t,n);
for i:=1 to n do
readln(t,a[i]);
close(t);
k:=0;
for i:=1 to n do
b[i]:=1;
for i:=1 to n do
 for j:=1 to i-1 do
  if (pos(a[j],a[i])<>0)and(b[j]>=b[i]) then
   begin
    b[i]:=b[j]+1;
    c[i]:=j;
   end;
   max:=0;
  for i:=1 to n do
   if b[i]>max then max:=b[i];
   assign(t,'link.out');
   rewrite(t);
   writeln(t,max);
   close(t);
 end.