@[WXYWXY1123](/user/764863) $f_1=0,f_2=1,f_n=(n-1)\times(f_{n-1}+f_{n-2})$
其中 $f_n$ 表示 $n$ 个东西错排的方案数
by LG086 @ 2024-09-20 23:18:51
@[LG086](/user/1159764) thanks
by WXYWXY1123 @ 2024-09-20 23:26:48
不建议单纯背公式
看看这个吧
https://blog.csdn.net/shulianghan/article/details/109438773
by GabrielAC_CSPS @ 2024-09-20 23:32:26