본문 바로가기

쿼드트리1

[백준✨] 1992번 <쿼드트리> / Python 문제풀이 / 해답) import sys def input(): return sys.stdin.readline() N = int(input()) board = [] for _ in range(N): board.append(list(input())) def isAllSame(s_r, s_c, n): chk = board[s_r][s_c] for i in range(n): for j in range(n): if board[s_r+i][s_c+j] != chk: return False return True def do(s_r, s_c, n): if n == 1: return board[s_r][s_c] if isAllSame(s_r,s_c, n): return board[s_r][s_c] l_u = str(do(s_r, s.. 2020. 10. 27.