Wednesday, April 06, 2011

UVa 634 Polygon

Solution: draw a vertical line segment L from point (x, y) to (x, MIN), and then count the number of intersection of L and polygon edges.

UVa 633 A Chess Knight

Solution: dynamic programming.

Note: consecutive movement of the same type is forbidden, and more than one movement type to reach a specific position is possible.