提交时间:2023-10-04 10:22:01

运行 ID: 104857

#include<bits/stdc++.h> using namespace std; #define int unsigned long long int a[1010],n; signed main() { cin>>n; a[2]=1, a[3]=2; for(int i=4;i<=n;++i) a[i]=(a[i-1]+a[i-2])*(i-1); cout<<a[n]; return 0; }