my solution to http://acm.whu.edu.cn/learn/