var h:array [1..2,1..20] of integer; hn:integer; procedure init; var i:integer; begin fillchar(h,sizeof(h),0); hn:=0; repeat inc(hn); read(h[1,hn]) until eof; end; procedure doit; var i,j,n:integer; begin for i:=1 to 20 do h[2,i]:=1; n:=1; for i:=hn-1 downto 1 do begin for j:=i+1 to hn do if (h[1,i]>=h[1,j]) and (h[2,i]<h[2,j]+1) then h[2,i]:=h[2,j]+1; if n<h[2,i] then n:=h[2,i]; end; writeln(n); end; begin init; doit; end.
付费偷看金额在0.1-10元之间
var
h:array [1..2,1..20] of integer;
hn:integer;
procedure init;
var i:integer;
begin
fillchar(h,sizeof(h),0);
hn:=0;
repeat
inc(hn);
read(h[1,hn])
until eof;
end;
procedure doit;
var i,j,n:integer;
begin
for i:=1 to 20 do h[2,i]:=1;
n:=1;
for i:=hn-1 downto 1 do
begin
for j:=i+1 to hn do
if (h[1,i]>=h[1,j]) and (h[2,i]<h[2,j]+1)
then h[2,i]:=h[2,j]+1;
if n<h[2,i] then n:=h[2,i];
end;
writeln(n);
end;
begin
init;
doit;
end.
一周热门 更多>