This commit is contained in:
HuangHai
2025-08-30 18:35:01 +08:00
commit 1f397eca87
6258 changed files with 1487241 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
#include <bits/stdc++.h>
using namespace std;
//本题有坑,使用长整也过不了洛谷的用例,因为它的用例是22,
//需要高精度,也就是乘法高精度+加法高精度
typedef long long LL;
int n;
LL res;
int main() {
cin >> n;
for (int i = 1; i <= n; i++) { // 1~n
LL f = 1; // 基底
for (int j = 1; j <= i; j++) f *= j; // f =n!
res += f; // 1!+2!+3!+...+n!
}
cout << res << endl;
return 0;
}