0928_14 @ 2023-10-04 17:55:31
#include<iostream>
#include<stdio.h>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
int main(){
int m=10000000,n;
cin>>n;
int sum[m]={0};
int ans[m]={0};
int t=0;
ans[0]=1;
for(int i=1;i<=n;i++){
t=0;
for(int j=0;j<i;j++){
ans[j]=ans[j]*i+t;
t=ans[j]/10;
ans[j]%=10;
}
t=0;
for(int j=0;j<i;j++){
sum[j]=ans[j]+sum[j]+t;
t=sum[j]/10;
sum[j]%=10;
}
}
int Y=m-1;
while(sum[Y]==0)Y--;
for(int i=Y;i>=0;i--)
{
cout<<sum[i];
}
return 0;
}