PE29

28に続き、力任せに集合に放り込んで解いた。

Pythonでは数行の実装で非常に簡単だったのだが、
C++で書こうとしたときに多倍長整数のような実装をしなければならず、
自力実装を諦め、boost::multiprecision を利用して実装した。

std::unordered_set<boost::multiprecision::cpp_int> にうまくinsertできなかったので、
std::unordered_set<std::string>にcpp_int.str()してからinsertして数えたのだが、
どうやればよかったのだろう。。。