https://www.luogu.org/problemnew/show/P3795 开始,我用了next_permutation,结果超时了。后来我发现了递推公式,f(n)=f(n-1)+(n-1)*f(n-2),再配合滚动数组,成功!