일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- expo
- 11053
- Combination
- lcm
- 파이썬
- itertools
- 나머지
- 1182
- Android
- 11054
- 코틀린
- 1260
- 뒤로가기
- Kotlin
- LCS
- 순열
- 11057
- 매일11시
- 안드로이드
- 앱
- Python
- 6603
- 백준
- 괄호
- permutation
- 최소공배수
- 홈화면
- 11기
- 코테
- 9095
Archives
- Today
- Total
목록12026 (1)
황소개발자
백준 12026 파이썬 python : BOJ 거리 @@황소처럼 우직하게@@ 시간초과 포비아 쉣더퍽
포비아포비아! n = int(input()) lst = input() ans = 999999999 def go(idx, cost): global ans if idx == n - 1: ans = min(ans, cost) return now = lst[idx] if now == 'B': for i in range(idx + 1, n): if lst[i] == 'O': go(i, cost + pow(i - idx, 2)) elif now == 'O': for i in range(idx + 1, n): if lst[i] == 'J': go(i, cost + pow(i - idx, 2)) elif now == 'J': for i in range(idx + 1, n): if lst[i] == 'B': go(i, ..
백준 문제 풀이
2020. 4. 24. 03:06