002 - Encyclopedia of Parentheses(★3)
DFSで全部作る
想定解はbit全探索だが判定しながらDFSで作れば枝刈りが効いて速そう
https://atcoder.jp/contests/typical90/submissions/58665467