#include<bits/stdc++.h> using namespace std; long long m,n,ans=1,a[5000005]; const long long mod=100000007; long long f(long long x){ long long w=mod-2,s=1,b=x; while(w!=0){ if(w&1==1)s=s*b%mod; b=b*b%mod; w>>=1; } return s; } int main(){ cin>>n>>m; a[1]=1; for(long long i=2;i<=n;i++){ a[i]=a[i-1]*i%mod; } cout<<a[n]*f(a[m]*a[n-m]%mod)%mod; return 0; }
标签:std,b%,9.20,const,long,mod From: https://www.cnblogs.com/zangqy/p/17723277.html