标签:void name log oid exp mes for const pac
namespace MathCal { typedef long long LL; static const LL mod = 1e9 + 7; static const int N = 1e5 + 5; LL fac[N], inv[N]; inline LL pow(LL x, LL exp) { LL res = 1; for (; exp; exp >>= 1, x = x * x % mod) if (exp & 1) res = res * x % mod; return res; } inline void pre() { for (int i = fac[0] = 1; i < N; i ++) fac[i] = fac[i - 1] * i % mod; inv[N - 1] = pow(fac[N - 1], mod - 2); for (int i = N - 1; i; i --) inv[i - 1] = inv[i] * i % mod; } inline LL Co(int x, int y) { return y > x ? 0 : fac[x] * inv[y] % mod * inv[x - y] % mod; } }
标签:void name log oid exp mes for const pac
原文地址:http://www.cnblogs.com/the-unbeatable/p/7818822.html