{"categories":["Codeforces"],"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyoshichi9.hatenablog.com%2Fentry%2F2019%2F05%2F17%2F003736\" title=\"Educational Codeforces R#65 (Div. 2) - C. News Distribution - Yoshichi\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","published":"2019-05-17 00:37:36","provider_name":"Hatena Blog","blog_url":"https://yoshichi9.hatenablog.com/","version":"1.0","title":"Educational Codeforces R#65 (Div. 2) - C. News Distribution","author_url":"https://blog.hatena.ne.jp/Yoshichi/","url":"https://yoshichi9.hatenablog.com/entry/2019/05/17/003736","type":"rich","height":"190","provider_url":"https://hatena.blog","author_name":"Yoshichi","blog_title":"Yoshichi\u306e\u65e5\u8a18","description":"\u554f\u984c\u6982\u8981 \u30b0\u30eb\u30fc\u30d7\u306b\u6240\u5c5e\u3059\u308b\u6570\u3092\u6570\u3048\u3088 Problem - C - Codeforces \u89e3\u6cd5 \u30b5\u30a4\u30ba\u4ed8\u304dUnionFind\u3092\u7528\u3044\u308b\u3002 \u304c\u3001(10^5) * 5\u306fPython\u3060\u3068\u76f8\u5f53\u304d\u3064\u3044\u3002 PyPy3\u3092\u7528\u3044\u305f\u304c\u3001Input\u95a2\u6570\u3092\u6b62\u3081\u3066sys.stdin.readline\u3067\u9ad8\u901f\u5316\u3057\u306a\u3044\u7121\u7406\u3060\u3063\u305f\u3002\u3002\u3002 \u53c2\u8003 www.kumilog.net \u63d0\u51fa\u30b3\u30fc\u30c9 # coding: UTF-8 import sys def find(x): if node[x] < 0: return x else: node[x] = find(node[x]) return node[x] def unite(x, \u2026","width":"100%","image_url":null}