Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<math.h>
- #define mod 1000000007
- using namespace std;
- long long f[100000];
- long long factorial(long long x){
- if(x == 0){
- return f[x];
- }
- long long ans = ((x) * (factorial(x-1)) * 1LL) % mod;
- f[x] = ans;
- return ans;
- }
- int main(){
- long long n ,m;
- cin >> n >> m;
- f[0] = 1;
- long long ans = ((factorial(n))/((f[m]) * (f[n-m]) * 1LL)) % mod;
- cout << ans;
- return 0;
- }
Add Comment
Please, Sign In to add comment