ac1004.pas

来自「某牛人写的acm.tongji.edu.cn上大部分ac的代码,仅供学习研究,请」· PAS 代码 · 共 27 行

PAS
27
字号
program tju1004;
const
  max=20;
var
  a,b,h:array[1..max]of word;
  i,j,m,n,x:byte;
begin
  repeat
    inc(i);
    read(a[i]);

    for j:=1 to i-1 do
      if a[j]>=a[i] then
        if b[j]>b[i] then b[i]:=b[j];
    inc(b[i]);
    if b[i]>m then m:=b[i];

    x:=0;
    for j:=1 to n do
      if h[j]>=a[i] then
        if x=0 then x:=j else if h[j]<h[x] then x:=j;
    if x=0 then begin inc(n);x:=n;end;
    h[x]:=a[i];
  until seekeof;
  writeln(m,' ',n);
end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?