Kyopro Library
 
読み取り中…
検索中…
一致する文字列を見つけられません
Combinatorics< T > 構造体テンプレート

二項係数・階乗計算 [詳解]

#include "combination.hpp"

公開メンバ関数

 Combinatorics ()=default
 
 Combinatorics (int n)
 二項係数の前計算
 
comb (ll n, ll r)
 nCr を返す
 
perm (ll n, ll r)
 nPr を返す
 
factrial (int n)
 n! を返す
 
factinv (int n)
 (n!)^-1 を返す
 
operator() (ll n, ll r)
 nCr を返す
 

詳解

template<typename T>
struct Combinatorics< T >

二項係数・階乗計算

combination.hpp5 行目に定義があります。

構築子と解体子

◆ Combinatorics() [1/2]

template<typename T>
Combinatorics< T >::Combinatorics ( )
default

◆ Combinatorics() [2/2]

template<typename T>
Combinatorics< T >::Combinatorics ( int n)
inline

二項係数の前計算

覚え書き
O(N)

combination.hpp10 行目に定義があります。

関数詳解

◆ comb()

template<typename T>
T Combinatorics< T >::comb ( ll n,
ll r )
inline

nCr を返す

覚え書き
n < 0, r < 0, n < r のときは 0 を返す

combination.hpp21 行目に定義があります。

◆ perm()

template<typename T>
T Combinatorics< T >::perm ( ll n,
ll r )
inline

nPr を返す

覚え書き
n < 0, r < 0, n < r のときは 0 を返す

combination.hpp28 行目に定義があります。

◆ factrial()

template<typename T>
T Combinatorics< T >::factrial ( int n)
inline

n! を返す

combination.hpp34 行目に定義があります。

◆ factinv()

template<typename T>
T Combinatorics< T >::factinv ( int n)
inline

(n!)^-1 を返す

combination.hpp37 行目に定義があります。

◆ operator()()

template<typename T>
T Combinatorics< T >::operator() ( ll n,
ll r )
inline

nCr を返す

combination.hpp40 行目に定義があります。

参照先 comb().


この構造体詳解は次のファイルから抽出されました: