Page 1 of 1
A Game - Usaco Sec 3 problem
Posted: Tue Jun 15, 2004 11:11 am
by b3yours3lf
hi,
i'm trying to solve this problem, but i don't understand what is mean by optimal strategy. is this mean player 2 always choose largest number that can be pick?
thanks for ur kind response.
Re: A Game - Usaco Sec 3 problem
Posted: Tue Jun 15, 2004 12:39 pm
by angga888
b3yours3lf wrote:i'm trying to solve this problem, but i don't understand what is mean by optimal strategy. is this mean player 2 always choose largest number that can be pick?
If I remembered correctly the answer for your question is NO. Player can also choose the smaller number if it will give him/her better result at the end of the game.
Hope it helps

Posted: Thu Jun 17, 2004 11:40 am
by kirya
This problem can be solved using DP. Let
sum[j] - sum of elements from i-th position till j-th position
f1[j] - first player score on this table
f2[j] - second player score on this table
f2[j]=sum[j]-f1[j].
answer is f1[1][n] and f2[1][n]