[백준 1987번] 알파벳 (Python3)
import sys input = sys.stdin.readline R,C = map(int,input().split()) alpha = [] for i in range(R): alpha.append(input().strip()) dy = [1,-1,0,0] dx = [0,0,1,-1] check = [0]*26 check[ord(alpha[0][0])-65] = 1 result = 0 def go(y,x,num): global result result = max(result,num) for i in range(4): y1 = y+dy[i] x1 = x+dx[i] if R>y1>=0 and C>x1>=0: if check[ord(alpha[y1][x1])-65]==0: check[ord(alpha[y1]..