This documentation is automatically generated by competitive-verifier/competitive-verifier
#pragma once
/*
* @brief Factorial(階乗)
*/
#ifndef call_include
#define call_include
#include <bits/stdc++.h>
using namespace std;
#endif
long long factorial(int x, long long p = (1LL << 62) - 1) {
long long res = 1;
for(int i = 2; i <= x; i++) (res *= i) %= p;
return res;
}
#line 2 "math/factorial.cpp"
/*
* @brief Factorial(階乗)
*/
#ifndef call_include
#define call_include
#include <bits/stdc++.h>
using namespace std;
#endif
long long factorial(int x, long long p = (1LL << 62) - 1) {
long long res = 1;
for(int i = 2; i <= x; i++) (res *= i) %= p;
return res;
}