Cod sursa(job #359568)

Utilizator tiger_10Dutescu Radu Alin tiger_10 Data 27 octombrie 2009 15:38:45
Problema Subsir crescator maximal Scor 5
Compilator fpc Status done
Runda Arhiva educationala Marime 0.72 kb
var i,n,k,p,c,b,d,a:longint;
        f,g:text;
begin
        assign(f,'scmax.in');
        reset(f);
        readln(f,n);
        k:=0;
        p:=0;
        d:=-maxint;
        for i:=1 to n do begin
                read(f,a);
                if(a>=d) then begin
                        inc(p);
                        if p>k then begin
                                k:=p;
                                b:=i-k;
                                c:=i;
                                end;
                        end
                        else p:=0;
                d:=a;

        end;
        close(f);
        assign(g,'scmax.out');
        rewrite(g);
        writeln(g,k);
        close(g);


end.