組み合わせ-DFS

ABC236D - Dance

考え方 回答例 考え方最大で$2N = 16$人.ペアの組み方は\begin{aligned} 15!! &= 15\times 13 \times \cdots \times 3 \times 1 \\ &=2,027,025 \end{aligned}となる(例えば以下のコード).よって,全探索できる. ans = 1 x = 15 while x > 0: ans *= x …