LIQ - Dãy con tăng dài nhất ( bản dễ )

Tác giả: flashmt

Ngôn ngữ: Pascal

uses math;
var n,i,j,re:longint;
    a,f:array[1..1002] of longint;

begin
        read(n);
        for i:=1 to n do
        begin
                read(a[i]);
                f[i]:=1;
                for j:=1 to i-1 do
                   if a[i]>a[j] then
                      f[i]:=max(f[i],f[j]+1);
                re:=max(re,f[i]);
        end;
        writeln(re);
end.

Download