记录编号 | 14803 | 评测结果 | AAAAAAAAAA | ||
---|---|---|---|---|---|
题目名称 | 393.[USACO Oct09] 牛棚回声 | 最终得分 | 100 | ||
用户昵称 | 是否通过 | 通过 | |||
代码语言 | Pascal | 运行时间 | 0.004 s | ||
提交时间 | 2009-11-05 09:13:07 | 内存使用 | 0.11 MiB | ||
program echo; var s1,s2:string; i,j,n,m,l1,l2,a1,a2:integer; begin assign(input,'echo.in'); assign(output,'echo.out'); reset(input); rewrite(output); readln(s1); readln(s2); l1:=length(s1); l2:=length(s2); n:=0; for i:=1 to l1 do begin for j:=1 to l2 do begin a1:=i; a2:=j; m:=0; while (s1[a1]=s2[a2])and(a1<=l1)and(a2<=l2) do begin inc(a1); inc(a2); inc(m); end; if m>n then n:=m; end; end; writeln(N); close(input); close(output); end.