<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>JunKobayashi</author_name>
  <author_url>https://blog.hatena.ne.jp/JunKobayashi/</author_url>
  <blog_title>JunKobayashi's Diary</blog_title>
  <blog_url>https://junkobayashi.hatenablog.com/</blog_url>
  <categories>
    <anon>包除原理</anon>
    <anon>二項係数mod</anon>
    <anon>UnionFind</anon>
  </categories>
  <description>＜問題のページ＞ AWC0165 D - ボールの箱詰め 包除原理を利用した基本的な解法を身に着けるのにうってつけの一問だった。本記事では\(P=998244353\)とする。なお、包除原理の詳細に関しては以下を参照されたし。 包除原理の２通りの証明 | 高校数学の美しい物語 ＜問題概要＞ 正の整数\(N,K\)および負でない整数\(M\)が与えられ、それぞれ\(1,2,\dots,N\)と採番された\(N\)個の箱と、それぞれ\(1,2,\dots,K\)と採番された\(K\)個のボールがある。以下3つの規則に従いつつ、ボールを箱に収めていくことを考える。 各ボールをいずれか1つの箱に入れ、…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fjunkobayashi.hatenablog.com%2Fentry%2F2026%2F10%2F06%2F121248&quot; title=&quot;AWC0165 D - ボールの箱詰め - JunKobayashi&amp;#39;s Diary&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-10-06 12:12:48</published>
  <title>AWC0165 D - ボールの箱詰め</title>
  <type>rich</type>
  <url>https://junkobayashi.hatenablog.com/entry/2026/10/06/121248</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
