<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>KokiYamaguchi</author_name>
  <author_url>https://blog.hatena.ne.jp/KokiYamaguchi/</author_url>
  <blog_title>Learning Algorithms</blog_title>
  <blog_url>https://kokiymgch.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>二部グラフのライブラリです。この問題で $verify$ しています。$DFS$ を実装するだけですが、持っておくと便利な時がたまにあります。二部グラフかどうかを判定したい無向グラフの隣接リストgを投げて使います。二部グラフではない場合は、-1が返ってきて、二部グラフである場合は、色を塗った時の片方の色の個数が返ってきます。 int BipartiteGraph(const vector&lt;vector&lt;int&gt;&gt; &amp;g) { int n = g.size(); vector&lt;int&gt; color(n, -1); int white_cnt = 0; function&lt;bool (int, in…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkokiymgch.hatenablog.com%2Fentry%2F2018%2F01%2F28%2F152346&quot; title=&quot;二部グラフのライブラリ - Learning Algorithms&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>2018-01-28 15:23:46</published>
  <title>二部グラフのライブラリ</title>
  <type>rich</type>
  <url>https://kokiymgch.hatenablog.com/entry/2018/01/28/152346</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
