songchunxi @ 2023-03-13 18:37:59
#include <bits/stdc++.h>
using namespace std;
int mix(long long x){
long long y=1;
for(int i=2;i<=x;i++){
y*=i;
}
return y;
}
int main(){
long long n,i,s=1;
cin>>n;
for(i=2;i<=n;i++){
s+=mix(i);
}
cout<<s<<endl;
return 0;
}
by _colin1112_ @ 2023-03-13 18:42:15
@songchunxi
对于100%的数据,1≤n≤50。
by linmil @ 2023-03-13 19:13:08
要用高精度运算
by wssb1919810 @ 2023-03-22 21:35:48
你悟了吗?