static void Main(string[] args) { string[] line = Console.ReadLine().Split(' '); startPosition = new Position(int.Parse(line[0]), int.Parse(line[1]), int.Parse(line[2])); line = Console.ReadLine().Split(' '); int L = int.Parse(line[0]); int R = int.Parse(line[1]); int C = int.Parse(line[2]); matrix = new char[L, R, C]; for (int i = 0; i < L; i++) { for (int j = 0; j < R; j++) { string row = Console.ReadLine(); for (int k = 0; k < C; k++) { matrix[i, j, k] = row[k]; } } } BFS(); Console.WriteLine(minSteps); }
static bool CheckPosition(Position position) { if (position.X >= 0 && position.X < matrix.GetLength(0) && position.Y >= 0 && position.Y < matrix.GetLength(1) && position.Z >= 0 && position.Z < matrix.GetLength(2)) { return true; } else { return false; } }