牛牛的字符串(dp):https://ac.nowcoder.com/acm/contest/7079/E
题解:https://ac.nowcoder.com/discuss/492088?type=101&order=time&pos=&page=1&channel=666&source_id=search_acm_post