文件目录

#include <bits/stdc++.h>
using namespace std;
vector<int> a(5000, 0);
vector<int> b(5000, 0);
int len = 1;
void mul(int k)
{
    int jw = 0;
    for (int i = 0; i < len + 5; i++)
    {
        a[i] *= k;
        a[i] += jw;
        if (a[i] >= 10)
        {
            jw = a[i] / 10;
            a[i] %= 10;
        }
        else
            jw = 0;
        b[i] += a[i];
    }
}
int main()
{
    int n;
    cin >> n;
    a[0] = b[0] = 1;
    for (int i = 2; i <= n; i++)
    {
        len += 3;
        mul(i);
    }
    for (int i = 0; i < b.size(); i++)
    {
        if (b[i] > 9)
        {
            b[i + 1] += b[i] / 10;
            b[i] %= 10;
        }
    }
    int i = b.size() - 1;
    while (b[i] == 0)
        i--;
    for (; i >= 0; i--)
        cout << b[i];
    return 0;
}