[baekjoon] 14888. 연산자 끼워넣기
로직 + 주의해야하는 점 1. 문제에서 말하는 그대로 +, -, x, %를 구분해 코드를 작성하면 된다 2. ** 문제점 : 나누기할 때, /로 나눈 다음에 int를 씌워서 나머지를 없앤다(처음에 //를 했다가 답이 제대로 안나옴) 코드 from itertools import permutations N = int(input()) numbers = list(map(int, input().split())) calcu = list(map(int, input().split())) eq = ['+', '-', '*', '/'] eq_t = [] for i in range(4): eq_t += eq[i] * calcu[i] result = list(permutations(eq_t, N-1)) answer = [] ..
더보기