Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 더현대서울 맛집
- 코로나19
- programmers
- Baekjoon
- 백준
- SW Expert Academy
- dacon
- PYTHON
- 자연어처리
- 데이콘
- Real or Not? NLP with Disaster Tweets
- 파이썬
- 편스토랑
- hackerrank
- 캐치카페
- gs25
- Docker
- Kaggle
- 우분투
- 프로그래머스
- leetcode
- ubuntu
- 맥북
- 금융문자분석경진대회
- Git
- 프로그래머스 파이썬
- github
- 편스토랑 우승상품
- AI 경진대회
- ChatGPT
Archives
- Today
- Total
솜씨좋은장씨
[BaekJoon] 9465번 : 스티커 (Python) 본문
728x90
반응형
1일 1문제 62일차!
오늘의 문제는 백준의 스티커입니다.
Solution
loopNum = int(input())
for i in range(loopNum):
inputNum = int(input())
nc = [[0]*3 for _ in range(inputNum+1)]
st = [list(map(int, input().split())) for _ in range(2)]
for j in range(1, inputNum+1):
nc[j][0] = max(nc[j-1][0], nc[j-1][1], nc[j-1][2])
nc[j][1] = max(nc[j-1][0], nc[j-1][2]) + st[0][j-1]
nc[j][2] = max(nc[j-1][0], nc[j-1][1]) + st[1][j-1]
print(max(nc[inputNum]))
'Programming > 코딩 1일 1문제' 카테고리의 다른 글
[BaekJoon] 1912번 : 연속합 (Python) (0) | 2020.04.10 |
---|---|
[Programmers] 힙 : 디스크 컨트롤러 (Python) (0) | 2020.04.09 |
[HackerRank] Minimum Absolute Difference in an Array (Python) (1) | 2020.04.07 |
[Programmers] 힙 : 더 맵게 (Python) (0) | 2020.04.06 |
[HackerRank] Time Conversion (Python) (0) | 2020.04.05 |
Comments