{"provider_url":"https://hatena.blog","author_name":"moistx","description":"\u554f\u984c\u6982\u8981 vector parent \u304c\u4e0e\u3048\u3089\u308c\u308b\u3002parent[i] \u3068\u306f i \u756a\u76ee\u306e\u30ce\u30fc\u30c9\u306e\u89aa\u304c parent[i] \u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3059\u3002deletedCell \u3067\u524a\u9664\u3059\u308b\u30ce\u30fc\u30c9\u304c\u4e0e\u3048\u3089\u308c\u305f\u3068\u304d\u3001\u6b8b\u3063\u305f\u30ce\u30fc\u30c9\u306e\u3046\u3061\u8449\u306e\u30ce\u30fc\u30c9\u306e\u6570\u3092\u30ab\u30a6\u30f3\u30c8\u305b\u3088\u3002\u89e3\u6cd5 \u5b50\u3092\u53c2\u7167\u3059\u308b\u5f62\u306e\u6728\u3092\u3001\u4e0e\u3048\u3089\u308c\u305f vector parent \u304b\u3089\u751f\u6210\u3057\u3001\u524a\u9664\u3059\u308b\u30ce\u30fc\u30c9\u3067\u6253\u3061\u5207\u3063\u3066 dfs \u3057\u3066\u3044\u3051\u3070\u3088\u3044\u3002 vector > tree; \u306b\u5bfe\u3057\u3066\u3001tree[ parent[i] ].push_back(i); \u3092 for\u6587\u3067\u56de\u3059\u3068\u6728\u304c\u751f\u6210\u3067\u304d\u308b\u3002\u305f\u3060\u3057\u3001\u6728\u5168\u4f53\u306e\u89aa\u30ce\u30fc\u30c9\u306b\u5bfe\u3057\u3066\u306f parent[i] = -1 \u3068\u306a\u308b\u306e\u3067\u3001t\u2026","blog_title":"Logfiles","blog_url":"https://logfiles.hatenablog.com/","width":"100%","author_url":"https://blog.hatena.ne.jp/moistx/","image_url":null,"type":"rich","url":"https://logfiles.hatenablog.com/entry/20140416/1397655200","title":"SRM435 Div1Easy(Div2Med) CellRemoval","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Flogfiles.hatenablog.com%2Fentry%2F20140416%2F1397655200\" title=\"SRM435 Div1Easy(Div2Med) CellRemoval - Logfiles\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","published":"2014-04-16 22:33:20","categories":["TopCoder","SRM"],"provider_name":"Hatena Blog","version":"1.0"}