2 条题解

  • 0
    @ 2023-11-26 8:37:55
    #include<bits/stdc++.h>
    using namespace std;
    #define int long long
    #define p 998244353
    int fpow(int a,int b){
        int res=1;
        while(b){
            if (b&1)res=res*a%p;
            a=a*a%p;
            b>>=1;
        }
        return res;
    }
    #define inv(n) fpow(n,p-2)
    int n,k;
    int fac[1005]={1,1};
    signed main(){
        ios::sync_with_stdio(0),cin.tie(nullptr),cout.tie(nullptr);
        cin>>n>>k;
        for (int i=2;i<1005;i++)fac[i]=fac[i-1]*i%p;
        cout<<fac[n]*inv(fac[k])%p*inv(fac[n-k])%p;
        return 0;
    }
    

    信息

    ID
    348
    时间
    1000ms
    内存
    256MiB
    难度
    9
    标签
    递交数
    95
    已通过
    4
    上传者