码迷,mamicode.com
首页 > Windows程序 > 详细

486. Predict the Winner

时间:2017-12-03 14:46:52      阅读:256      评论:0      收藏:0      [点我收藏+]

标签:one   this   rom   continue   core   until   you   res   array   

Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each time a player picks a number, that number will not be available for the next player. This continues until all the scores have been chosen. The player with the maximum score wins.

Given an array of scores, predict whether player 1 is the winner. You can assume each player plays to maximize his score.

486. Predict the Winner

标签:one   this   rom   continue   core   until   you   res   array   

原文地址:http://www.cnblogs.com/vectors07/p/7965936.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!