DFS

๋ฌธ์ œhttps://www.acmicpc.net/problem/14888 ์ฝ”๋“œn = int(input())num = list(map(int, input().split()))operation = list(map(int, input().split())) # +, -, *, /maxi = -1e9mini = 1e9def dfs(idx, result, plus, minus, multiply, divide): global maxi, mini if idx == n: maxi = max(result, maxi) mini = min(result, mini) return if plus > 0: dfs(idx + 1, result + num[idx], pl..
๋•ก๋•ก๐Ÿ‘ฉ๐Ÿป‍๐Ÿ’ป
'DFS' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก