f[i,j*k]:=f[i,j*k]+f[i-1,j];
设f[i,j]表示前i个,当那一位数字为j*k的时候的最大好序列个数
代码如下:
const
maxn=2000;
p=1000000007;
var
f:array [1..maxn,1..maxn] of longint;
i,j,k,n,m:longint;
ans:int64;
begin
readln(n,m);
for i:=1 to n do
f[1,i]:=1;
for i:=2 to m do
for j:=1 to n do
for k:=1 to n div j do
f[i,j*k]:=(f[i,j*k]+f[i-1,j]) mod p;
for i:=1 to n do ans:=(ans+f[m,i]) mod p;
writeln(ans);
end.