백준 / 14500번 테트로미노- 백트래킹, dfs / Python 파이썬
·
coding test - python/백준
*문제 출처는 백준에 있습니다.문제 제목: 테트로미노문제 사이트: https://www.acmicpc.net/problem/14500 나의 풀이 - 첫번째 풀이 시간초과import sysinput = sys.stdin.readlineN,M = map(int,input().split())direct = ((-1,0),(1,0),(0,-1),(0,1)) # 상하좌우maps = []max_sum = 0for i in range(N): # 종이에 쓰여 있는 수 maps.append(list(map(int,input().split())))def dfs(visited_points,cnt,total): global max_sum # 백트래킹은 dfs if cnt == 4: ..