update to names of template
This commit is contained in:
parent
d9d98c8b7c
commit
8c4ccc5a2f
@ -23,13 +23,13 @@ using namespace std;
|
|||||||
#define MOD 1000000007
|
#define MOD 1000000007
|
||||||
#define LLM 1000000000000000007
|
#define LLM 1000000000000000007
|
||||||
|
|
||||||
ll fact(ll n) { if(n==0) return 1; ll res = 1; for (ll i = 2; i <= n; i++) res = res * i; return res; }
|
ll factorial(ll n) { if(n==0) return 1; ll res = 1; for (ll i = 2; i <= n; i++) res = res * i; return res; }
|
||||||
ll nPr(ll n, ll r) { return fact(n) / fact(n - r); }
|
ll nPr(ll n, ll r) { return factorial(n) / factorial(n - r); }
|
||||||
ll nCr(ll n, ll r) { return fact(n) / (fact(r) * fact(n - r)); }
|
ll nCr(ll n, ll r) { return factorial(n) / (factorial(r) * factorial(n - r));}
|
||||||
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
|
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
|
||||||
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b);}
|
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b);}
|
||||||
ull mypow(ull a, ull b) { ull ans = 1; a%=MOD; while(b){ if (b&1) ans = (ans*a) % MOD; a = (a*a) % MOD; b >>= 1; } return ans; }
|
ull mypow(ull a, ull b) { ull ans = 1; a%=MOD; while(b){ if (b&1) ans = (ans*a) % MOD; a = (a*a) % MOD; b >>= 1; } return ans; }
|
||||||
bool isPrime(ll n) { if(n <= 1) return false; for(ll i = 2; i <= sqrt(n); i++) if(n % i == 0) return false; return true; }
|
bool isPrime(ll n) { if(n <= 1) return false; for(ll i = 2; i*i <= n; i++) if(n % i == 0) return false; return true; }
|
||||||
|
|
||||||
#ifndef ONLINE_JUDGE
|
#ifndef ONLINE_JUDGE
|
||||||
#define dbg(x) cerr << #x <<" "; _print(x); cerr << endl;
|
#define dbg(x) cerr << #x <<" "; _print(x); cerr << endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user