记忆化搜索(数位dp)
https://ac.nowcoder.com/acm/contest/5671/H
https://ac.nowcoder.com/acm/contest/7852/C