Pagini recente » Cod sursa (job #1453169) | Cod sursa (job #2160538) | Cod sursa (job #1438129) | Cod sursa (job #1876074) | Cod sursa (job #316693)
Cod sursa(job #316693)
uses math;
var x,ad,ad1,nr:array[0..100000] of longint;
i,j,a,b,n:longint;
t:text;
begin
assign(t,'scmax.in'); reset(t);
readln(t,n);
for i:=1 to n do
begin
read(t,nr[i]);
x[i]:=1;
for j:=i-1 downto 1 do
begin
if (nr[j]<nr[i]) then
if (x[j]+1>x[i]) then
x[i]:=x[j]+1;
end;
end;
assign(t,'scmax.out'); rewrite(t);
j:=1;
for i:=1 to n do
if x[i]>j then j:=x[i];
writeln(t,j);
close(t);
end.