카카오 2022 파괴 되지 않는 건물
파이썬 (정확도만 통과) #skill = [type, r1, c1, r2, c2, degree] from multiprocessing.connection import answer_challenge def solution(board, skill): answer = 0 for arr in skill: if arr[0] == 1 : #공격 attack(board, arr) elif arr[0] == 2: #회복 heal(board, arr) for arr in board: for i in arr: if i > 0 : answer += 1 return answer def attack(board, arr): x1, y1, x2, y2 , degree = arr[1:6] for i in range(x1, x2+1)..
[다시 풀어보기] 백준 14888번 "연산자 끼워넣기"
파이썬 import sys n = int(sys.stdin.readline().rstrip()) nums = list(map(int, sys.stdin.readline().split())) a, s, m, d = map(int, sys.stdin.readline().split()) minmaxList= [] def dfs(i, num): global a, s, m, d, minmaxList if i == n: minmaxList.append(num) return if a > 0 : a -= 1 dfs(i+1, num +nums[i]) a += 1 if s > 0 : s -= 1 dfs(i+1, num - nums[i]) s += 1 if m > 0 : m -= 1 dfs(i+1, num * nums[i]..