
백준 / 14888번 / 연산자 끼워넣기 / python 파이썬 / 백트래킹
·
코딩테스트/백준 (python)
문제 : https://www.acmicpc.net/problem/14888 코드N = int(input())nums = list(map(int, input().split()))op = list(map(int, input().split()))maxn = -1e9minn = 1e9def dfs(n, i, add, sub, mul, div): global maxn, minn if i == N: maxn = max(maxn, n) minn = min(minn, n) return else: if add: dfs(n + nums[i], i+1, add - 1, sub, mul, div) if sub: ..