코딩테스트/프로그래머스
2024. 10. 25.
[프로그래머스] 도둑질
🔗 문제 링크https://school.programmers.co.kr/learn/courses/30/lessons/42897# 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr👩💻 코드#include #include #include using namespace std;int solution(vector money) { int n = money.size(); vector dpFirst(n, 0); dpFirst[0] = money[0]; dpFirst[1] = max(money[0], money[1]); for (int i = 2; i dpLast(n, 0..