Rosetta Problems

Hafnian of Matrix

https://judge.yosupo.jp/problem/hafnian_of_matrix