参考:http://www.cnblogs.com/kuangbin/archive/2011/08/28/2156426.html
下面写一下入门题以及算法分析
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2188
分析: