-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcp-template.cpp
More file actions
64 lines (55 loc) · 1.1 KB
/
cp-template.cpp
File metadata and controls
64 lines (55 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define pb push_back
#define mod 1000000007
#define mp make_pair
ll fact[200005];
ll powermod(ll x,ll y){
if(y==0) return 1;
ll temp = powermod( x,y/2 )%mod;
if( y%2 ){
return (((temp*temp)%mod)*x%mod);
}
return (temp*temp)%mod;
}
ll power(ll x,ll y){
if(y==0) return 1;
ll temp = power( x,y/2 );
if( y%2 ){
return (((temp*temp))*x);
}
return (temp*temp);
}
int gcd (int a, int b) {
return b ? gcd (b, a % b) : a;
}
ll inv(ll a, ll p){
return powermod(a,mod-2);
}
ll nCr(ll n, ll r, ll p){
if(r > n) return 0;
ll t1 = fact[n];
ll t2 = inv(fact[r],p);
ll t3 = inv(fact[n-r],p);
return (((t1*t2)%p)*t3)%p;
}
void solve(){
return;
}
signed main(){
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
ll t=1;
// cin>>t;
// srand(time(0));
// fact[0]=1;
// for(int i=1;i<200001;i++){
// fact[i]=i*fact[i-1];
// fact[i]%=mod;
// }
while (t--){
solve();
}
return 0;
}