人生を書き換える者すらいた。: 人材獲得作戦・4 試験問題ほか 30分くらい。 知らなければなかなか解けない問題だし仕事でこういうプログラム書くことは無いんだろうな、とは思う。 maze = open("input.txt","r").read().splitlines() w = len(maze[0]) h = len(maze) inf = w*h for y in range(h): for x in range(w): if maze[y][x] == "S": sx = x; sy = y if maze[y][x] == "G": gx = x; gy = y dist = [[(inf,)]*w for y in range(h)] dist[sy][sx] = (0,) for i in range(0,inf): if dist[gy][gx][0] < inf: br