*문제 출처는 백준에 있습니다.
문제 제목: 안녕 / 1535번 (실버 2단계)
문제 사이트: https://www.acmicpc.net/problem/1535
문제 설명

나의 풀이
if __name__=="__main__":
n = int(input())
people = list(map(int, input().split()))
enough = list(map(int, input().split()))
stamina = [0] * (100)
for peo, eno in zip(people, enough):
for i in range(99, peo - 1, -1):
stamina[i] = max(stamina[i], stamina[i - peo] + eno)
print(max(stamina))

※ 알아야 할 것
https://www.acmicpc.net/problem/12865
배낭 문제랑 같은 것 같습니다!
'Coding Test > 백준-Python' 카테고리의 다른 글
| 백준 / 카잉 달력 / 6064번 / Python (0) | 2025.10.16 |
|---|---|
| 백준 / 전기 요금 / 5710번 / Python (0) | 2025.10.16 |
| 백준 / 미확인 도착지 / 9370번 / Python (0) | 2025.09.19 |
| 백준 / 욕심쟁이 판다 / 1937번 / Python (0) | 2025.09.12 |
| 백준 / 텔레포트 / 16958번 / Python (1) | 2025.09.10 |