일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 |
Tags
- 11057
- LCS
- 최소공배수
- 1260
- 9095
- 순열
- 나머지
- Combination
- 11054
- 홈화면
- permutation
- 6603
- 코틀린
- Kotlin
- itertools
- 뒤로가기
- 안드로이드
- 매일11시
- Python
- 괄호
- 11053
- 코테
- Android
- 앱
- 파이썬
- expo
- 11기
- lcm
- 1182
- 백준
Archives
- Today
- Total
목록2156 (1)
황소개발자
백준 2156 파이썬 python : 포도주 시식 @@황소처럼 우직하게@@ 포도주 땡기네
먹지않거나 연속으로 한잔을 먹는 경우이거나 연속으로 두잔을 먹는 경우이거나 import sys input = sys.stdin.readline n = int(input()) wine = [0] for i in range(n): wine.append(int(input())) dp = [[0, 0, 0] for i in range(n + 1)] dp[1] = [0, wine[1], 0] for i in range(2, n + 1): dp[i][0] = max(dp[i - 1]) dp[i][1] = dp[i - 1][0] + wine[i] dp[i][2] = dp[i - 1][1] + wine[i] print(max(dp[n])) 범인은 이 안에 있다
백준 문제 풀이
2020. 3. 4. 06:43