leq[p_,q_]:=如果[Length[p]<Length[q],False,模块[{i,ds},对于[i=1;ds=0,i<Length[C],i++,如果[(ds+=q[[i]]-p[i]])<0,返回[False]]];正确]];maxac[l]:=如果[Length[l]<=1,Length[1],maxac[l]=Max[maxac[Drop[l,1]],1+maxac[Select[l,!leq[#,l[[1]]]&&!leq[l[[1],#]&]]];a[n_]:=a[n]=maxac[IntegerPartitions[n]]