我们三个人的精神的高度凝结的到了这套组合数模板
#include<iostream>
#include<string>
#include<cstring>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#include<vector>
using namespace std;
# define inf 0x3f3f3f3f
# define ll long long
# define LL_INF 0x3f3f3f3f3f3f3f3f
ll gcd(ll t1,ll t2)
{
if(t1<t2)swap(t1,t2);
return t1%t2==0? t2 : gcd(t2,t1%t2);
}
ll c( ll t1,ll t2)
{
if(t1>t2)swap(t1,t2);
ll temp1=1,temp2=1,temp,sum1=1,sum2=1;
temp1=min(t1,t2-t1);
temp2=max(t1,t2-t1);
for(int i=1; i<=temp1; i++)
{
sum2*=i;
}
for(int i=temp2+1; i<=t2; i++)
{
sum1*=i;
temp=gcd(sum1,sum2);
sum1/=temp;
sum2/=temp;
}
return sum1;
}
int main()
{
ll n,m;
cin>>n>>m;
cout<<c(n,m)<<endl;
return 0;
}