{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fjeneshicc.hatenadiary.org%2Fentry%2F20100212%2F1265992164\" title=\"\u6700\u5c0f\u5168\u57df\u6728 \u30af\u30e9\u30b9\u30ab\u30eb\u6cd5 - \u843d\u66f8\u304d\u3001\u6642\u3005\u843d\u5b66\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","author_url":"https://blog.hatena.ne.jp/jeneshicc/","url":"https://jeneshicc.hatenadiary.org/entry/20100212/1265992164","version":"1.0","categories":["algorithm","C++","Memo"],"blog_title":"\u843d\u66f8\u304d\u3001\u6642\u3005\u843d\u5b66","author_name":"jeneshicc","blog_url":"https://jeneshicc.hatenadiary.org/","provider_name":"Hatena Blog","title":"\u6700\u5c0f\u5168\u57df\u6728 \u30af\u30e9\u30b9\u30ab\u30eb\u6cd5","height":"190","published":"2010-02-12 01:29:24","image_url":null,"provider_url":"https://hatena.blog","description":"UnionFind\u3055\u3048\u3042\u308c\u3070\uff0c\u7d50\u69cb\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u308b\u306e\u306d\uff0e \u305f\u3060\uff0c\u6b63\u3057\u304f\u52d5\u304f\u304b\u307b\u3068\u3093\u3069\u78ba\u8a8d\u3057\u3066\u3044\u306a\u3044\u306e\u3067\uff0c\u30d0\u30b0\u304c\u3042\u308b\u304b\u3082\uff0e // disjoint_set.h #include <iostream> using namespace std; class UnionFind { private: int *root, *rank; // root < 0 \u306e\u3068\u304d\u306f\u30b5\u30a4\u30ba\u306e\u60c5\u5831 public: UnionFind(const int &n) { root = new int[n], rank = new int[n]; fill_n(root, n, -1), fill_n(rank, n, 0);\u2026","type":"rich"}