Union-Find
やや無理やり通したので,釈明を残しておこうと思いました. 問題文 https://code-thanks-festival-2017.contest.atcoder.jp/tasks/code_thanks_festival_2017_h 問題概要 (原文が日本語かつ十分に簡潔なので省略)
問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13648&rd=16312 問題概要 頂点の(連結とは限らない)単純無向グラフが与えられる.グラフは の文字の行列 として与えられる. が 'Y' のとき,2 頂点 を結ぶ辺が存在することを表し,'N'…