알고리즘/SW expert Academy
[SW expert Academy] SWEA 5215번 햄버거 다이어트 파이썬(Python)
츄르사려고 코딩하는 코집사입니다. 1. [SW expert Academy] SWEA 5215번 햄버거 다이어트 파이썬(Python) 2. 코드 - 이 문제는 powerset 알고리즘을 이용하면 된다. def search(index, total_score, total_cal): global taste if total_cal > L: return if index >= N: if total_score > taste: taste = total_score return search(index + 1, total_score + score_list[index], total_cal + cal_list[index]) search(index + 1, total_score, total_cal) T = int(input()) ..
2021. 1. 13.
최근댓글