USACO Section3.3 game1

Problem Summary

Two players play a game with a sequence of N positive integers laid onto a 1*N game board. Player 1 starts the game and they move alternately by selecting a number from either the left or the right end of the board. The selected number is then deleted, and its value is added to the score of the player who selected it. Whoever has the greater sum in the end wins.
Write a program that implements the optimal strategy for player 2. The optimal strategy yields maximum points when playing against the “best possible” opponent.

Read More

USACO Section3.3 camlot

Problem Summary

Given a board with R rows and C columns, a king and some(from zero to R*C) knights, and their moving patterns, compute the minimum number of moves the player must perform to gather them all in the same square.

Specially, whenever the king and any knight are placed in the same square, the player may choose to move the king and the knight together from that point on, as a single knight.

Read More