可以搜一下猴子选大王的算法,是一个道理。
参考:
http://blog.sina.com.cn/s/blog_ae3a507a01018j58.html
http://www.likecs.com/show-31639.html