1 solutions

  • -1
    @ 2024-5-1 22:42:25
    #include<iostream>
    using namespace std;
    int n,k,h;
    int main(){
        cin>>n>>k>>h;
        long long ans1=1,k1=k;
        if(k>n){
            cout<<0<<endl;
            return 0;
        }
        for(int i=1;i<=h;i++){
            int x;
            cin>>x;
            for(int j=1;j<=x;j++)    ans1*=j;
        }
        long long ans2=1;
        for(int i=n;i>=n-k+1;i--)    ans2*=i*i;
        cout<<ans2/ans1<<endl;
        return 0;
    }
    
    • 1

    Information

    ID
    490
    Time
    1000ms
    Memory
    125MiB
    Difficulty
    2
    Tags
    # Submissions
    2
    Accepted
    2
    Uploaded By