<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kaage</author_name>
  <author_url>https://blog.hatena.ne.jp/kaage/</author_url>
  <blog_title>kaage精進録</blog_title>
  <blog_url>https://kaage.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>問題リンク 数え上げ，苦手 解説 数をグループにして考える．$h$ に含まれる $i$ の数を $n_i$ としておく． $n_i$ 個の数があるグループの中に重複を少なくとも $k$ ペア作る方法の数は $\binom{n_i}{2k}(2k-1)!!$ 通りある． これを多項式の係数にして畳み込みすると，全体について重複を少なくとも $k$ ペア作る方法の数が求まる． これが求まったら，残りの組み方は $(2N-2K-1)!!$ 通りあるので，これをかけて包除すると解ける． 畳み込みは，FFTを平衡二分木を作る要領でやると $O(N\log^2N)$ なので，全体でも $O(N\log^2…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkaage.hatenablog.com%2Fentry%2F2021%2F03%2F01%2F020050&quot; title=&quot;ACL Beginner Contest F - Height and Pairs 解説 - kaage精進録&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn.user.blog.st-hatena.com/default_entry_og_image/154818125/1592546778599961</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-03-01 02:00:50</published>
  <title>ACL Beginner Contest F - Height and Pairs 解説</title>
  <type>rich</type>
  <url>https://kaage.hatenablog.com/entry/2021/03/01/020050</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
