A 求导
题目地址:
基本思路:
本质就是一个阶乘,随便搞搞。
参考代码:
#pragma GCC optimize(2) #pragma GCC optimize(3) #include <bits/stdc++.h> using namespace std; #define IO std::ios::sync_with_stdio(false) #define int long long #define rep(i, l, r) for (int i = l; i <= r; i++) #define per(i, l, r) for (int i = l; i >= r; i--) #define mset(s, _) memset(s, _, sizeof(s)) #define pb push_back #define pii pair <int, int> #define mp(a, b) make_pair(a, b) #define INF 0x3f3f3f3f const int mod = 1e9 + 7; int n; signed main() { IO; cin >> n; int res = 1; rep(i,1,n){ res = res * i % mod; } cout << res << '\n'; return 0; }