P2976 [USACO10JAN] Shipping Around an Island G

题目描述

Farmer John decided to start his own cruise ship line! He has but one ship, but is hoping for big growth. He recently acquired a map of the area of ocean where his cruise ship will operate. It looks something like the diagram below, with height H (3

输入格式

\* Line 1: Two space-separated integers: H and W \* Lines 2..H+1: Line i+1 contains contains W characters that are the elements of map row i (all '.' or 'x' or 'A')

输出格式

\* Line 1: The minimum length of a path that Farmer John's cruise ship can take