11050 - 이항 계수 1

solution

code

#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int N, K;
    cin >> N >> K;
    cout << tgamma(N+1) / (tgamma(K+1) * tgamma(N-K+1)) << endl;

    return 0;
}

ref

11050번: 이항 계수 1

[조합론] 이항계수 알고리즘 3가지

Is there any built-in factorial function in c++?