PersonalCorpus 版 (精华区)
寄信人: sino (蚱蜢舟)
标 题: 1102
发信站: 哈工大紫丁香 (2002年03月26日13:38:14 星期二)
来 源: mtlab4.hit.edu.cn
172168 05:40:14 26 Mar 2002
Bozhang,HIT,P.R.China 1102 Pascal Accepted 1.642 sec 852K
172167 05:38:49 26 Mar 2002
Bozhang,HIT,P.R.China 1102 Pascal Accepted 1.782 sec 131K
var
s:array[1..400000] of char;
m:array[1..400000] of boolean;
i,n,len:integer;
begin
readln(n);
len:=6;
m[6]:=true;m[5]:=false;m[4]:=false;m[3]:=false;m[2]:=false;m[1]:=false;
while n>0 do begin
while len<400000 do begin
inc(len); read(s[len]);
if eoln(input) then break;
end;
for i:=7 to len do begin
m[i]:=false;
case s[i] of
't':if s[i-1]='u' then begin
if m[i-3] then
if (s[i-2]='o') then begin m[i]:=true; continue
end;
if m[i-6] then
if (s[i-2]='p') and (s[i-3]='t') and (s[i-4]='u'
) and (s[i-5]='o') then begin m[i]:=true; continue end;
if m[i-5] then
if (s[i-2]='p') and (s[i-3]='n') and (s[i-4]='i'
) then begin m[i]:=true; continue end;
end;
'e':if m[i-3] then
if (s[i-1]='n') and (s[i-2]='o') then m[i]:=true;
'n':begin
if m[i-2] then if (s[i-1]='i') then begin m[i]:=true;
continue end;
if m[i-5] then if (s[i-1]='o') and (s[i-2]='t') and (
s[i-3]='u') and (s[i-4]='p') then
begin m[i]:=true; continue end;
end;
end;
end;
if eoln(input) then begin
dec(n); readln;
if m[len] then writeln('YES') else writeln('NO');
len:=6;
m[6]:=true;m[5]:=false;m[4]:=false;m[3]:=false;m[2]:=false;m[1]:
=false;
end else begin
len:=6;
for i:=1 to 6 do begin
s[i]:=s[399994+i];
m[i]:=m[399994+i];
end;
end;
end;
end.
--
我一直认为马佩军是西电编程第一高手,他编程的时候根本不是人,是指针。
--《阳光男孩之大学十年》
※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: mtlab4.hit.edu.cn]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.426毫秒