Pagini recente » Cod sursa (job #2813773) | Cod sursa (job #2797198) | Cod sursa (job #2678123) | Cod sursa (job #2129951) | Cod sursa (job #316689)
Cod sursa(job #316689)
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:=1 to i-1 do
begin
if (nr[j]<nr[i]) then
if (x[j]+1>x[i]) then
begin
x[i]:=x[j]+1;
end;
end;
end;
close(t);
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.