Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- typedef unsigned long long ull;
- typedef pair<ll,ll>pll;
- typedef pair<ll,pair<ll,ll>>plll;
- #define bismillah; (ios_base:: sync_with_stdio(false),cin.tie(NULL));
- #define vll(v) v.begin(),v.end()
- #define all(x) x.rbegin(),x.rend()
- #define min3(a, b, c) min(a, min(b, c))
- #define max3(a, b, c) max(a, max(b, c))
- #define ff first
- #define ss second
- #define in freopen("input.txt", "r", stdin)
- #define out freopen("output.txt", "w", stdout)
- #define minheap int,vector<int>,greater<int>
- #define pb push_back
- #define eb emplace_back
- #define ischar(x) (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z'))
- #define isvowel(ch) ((ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')||(ch=='A'|| ch=='E' || ch=='I'|| ch=='O'|| ch=='U'))
- #define bug cout<<"BUG"<<endl;
- const int Max = 2e5 ;
- const int Mod = 1e9 + 7;
- ll fact[Max+10];
- long long bigmod(long long b,long long p,ll mod)
- {
- if(p==0)return 1ll;
- ll x=bigmod(b,p/2,mod);
- x=(x*x)%mod;
- if(p&1)x=(x*b)%mod;
- return x;
- }
- void init()
- {
- fact[0]=1;
- for(ll i=1; i<=Max; i++)
- {
- fact[i]=(i*fact[i-1])%Mod;
- }
- }
- ll NCR(ll n,ll r)
- {
- return (fact[n]*bigmod((fact[r]*fact[n-r])%Mod,Mod-2,Mod))%Mod;
- }
- int main()
- {
- bismillah;
- cin>>nn>>rr;
- ll ans=NCR(nn,rr);
- cout<<ans<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement