DFS 답은 맞는데, 시간 초과 뜸 import sys input = sys.stdin.readline n = int(input()) # g = [[0]*(n+1)] + [[0] + list(map(int, input().split())) for _ in range(n)] g = [list(map(int, input().split())) for _ in range(n)] dx = [0,1] dy = [1,0] visited = [[0]*len(range(n)) for _ in range(n)] def DFS(x,y): global ways global visited if x==n-1 and y==n-1: ways+=1 visited = [[0]*len(range(n)) for _ in range(n)] ..