最后一点超了,为什么?

var

a,s1,s2:array[0..1000000] of longint;

i,j,k,n,t,m,x,m1:longint;

begin

readln(n,k);

for i:=1 to n do read(a[i]);

m:=1;

s1[1]:=a[k];

s1[0]:=maxlongint;

for i:=k-1 downto 1 do begin

x:=a[i];

t:=m;

while x>=s1[t] do dec(t);

if t=m then begin

inc(m);

s1[m]:=a[i];

end else if t0 then s1[t+1]:=a[i];

end;

m1:=m;

m:=1;

s2[1]:=a[k];

s2[0]:=-5;

for i:=k+1 to n do begin

x:=a[i];

t:=m;

while x

0 条评论

目前还没有评论...

信息

ID
1369
难度
7
分类
动态规划 | LIS 点击显示
标签
递交数
3230
已通过
539
通过率
17%
被复制
3
上传者