I have been puzzled.大家快来看看这道题目:

idler 2001-10-11 10:23:09
A Game
IOI'96 - Day 1
Consider the following two-player game played with a sequence of N positive integers (2 <= N <= 100) laid onto a game board. Player 1 starts the game. The players move alternately by selecting a number from either the left or the right end of the sequence. That number is then deleted from the board, and its value is added to the score of the player who selected it. A player wins if his sum is greater than his opponents.

If the board initially contains an even number of elements, then Player 1 has a strategy that guarantees a win or a tie. Write a program that implements the optimal winning strategy. The optimal strategy yields maximum points when playing against the "best possible" opponent. Your program must further implement an optimal strategy for player 2.

PROGRAM NAME: game1
INPUT FORMAT
Line 1: N, the size of the board
Line 2-etc: N integers in the range (1..200) that are the contents of the game board, from left to right

SAMPLE INPUT (file game1.in)
6
4 7 2 9
5 2

OUTPUT FORMAT
Two space-separated integers on a line: the score of Player 1 followed by the score of Player 2.
SAMPLE OUTPUT (file game1.out)
18 11

看上去就是IOI '96的第一题,但是下面的数据却不对:
30
105 57 64 79 188 102 52 145 188 2 163 147 174 163 198 9 133 159 184 104 70
19 57 174 184 57 154 123 106 129
...全文
103 1 打赏 收藏 举报
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
alwzh 2001-10-12
请译为中文
  • 打赏
  • 举报
回复
发帖
数据结构与算法
加入

3.2w+

社区成员

数据结构与算法相关内容讨论专区
社区管理员
  • 数据结构与算法社区
申请成为版主
帖子事件
创建了帖子
2001-10-11 10:23
社区公告
暂无公告