티스토리 뷰
문제출처 - https://programmers.co.kr/learn/courses/30/lessons/12913
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
def solution(land):
# n행 4열
for i in range(len(land) - 1):
land[i + 1][0] = max(land[i][1], land[i][2], land[i][3]) + land[i+1][0]
land[i + 1][1] = max(land[i][0], land[i][2], land[i][3]) + land[i+1][1]
land[i + 1][2] = max(land[i][0], land[i][1], land[i][3]) + land[i+1][2]
land[i + 1][3] = max(land[i][0], land[i][1], land[i][2]) + land[i+1][3]
return max(land[-1])
간단한..dp문제였음...
'ALGORITHM > 프로그래머스' 카테고리의 다른 글
[Python][2020 KAKAO] 프로그래머스 - 문자열 압축(LEVEL2) (2) | 2020.03.20 |
---|---|
[Python] 프로그래머스 - 짝지어 제거하기(LEVEL2) (0) | 2020.03.14 |
[Python][2019 KAKAO] 프로그래머스 - 오픈채팅방(LEVEL2) (0) | 2020.03.14 |
[MYSQL]프로그래머스 - DATETIME에서 DATE로 형 변환(LEVEL2) (0) | 2020.03.12 |
[MYSQL]프로그래머스 - 오랜 기간 보호한 동물2(LEVEL3) (0) | 2020.03.12 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 프로그래머스
- SW Expert
- 백준
- 구현
- 2020 KAKAO BLIND RECRUITMENT
- 힙
- Python
- C++
- 괄호
- Permutation
- combination
- 정렬
- 코딩테스트
- 재귀
- SWExpert
- left join
- 문자열
- BOJ
- 문자열처리
- programmers
- dictionary
- 스택
- 2019 Kakao Blind Recruitment
- hash
- 파이썬
- 우선순위큐
- 해시
- 딕셔너리
- 완전탐색
- 순열
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함