Algorithm(BOJ, Python)/Backtracking(Recursion)1 [백준_15686] 치킨배달 python 재귀함수를 이용하여, 조합을 만들어 주는 법을 미리 알고 있어야 수월하게 해결할 수 있는 문제다. import sys # n, m 입력 n, m = map(int, input().split()) # town town = [ list(map(int, input().split())) for _ in range(n) ] # ans_list ans_list = [] # calc() def calc(): # ans_list 갱신 global ans_list # 전체 거리 total_dist = 0 for house in house_pos: # 집 위치 언팩킹 hx, hy = house # 치킨 거리 chicken_dist = sys.maxsize for chicken in alive_chicken_pos: # 치.. 2022. 8. 14. 이전 1 다음