Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- 백준 19238
- 백준 16236
- 백준 16719
- Spring
- 백준 파이썬
- JPA
- 백준 15685
- spring cloud
- MSA
- 파이썬
- 프로래머스
- sql 기술면접
- springboot
- 프로그래머스
- Coroutine
- 백준 17626
- java
- re.split
- with recursive
- spring oauth
- java 기술면접
- spring security
- MySQL
- Kotlin
- Spring Boot
- 백준
- JVM
- 백준 16235
- 백준 17779
- 웹어플리케이션 서버
Archives
- Today
- Total
목록백준 13549 (1)
시작이 반

수빈이가 다음 장소로 갈 경우는 3가지이다. x-1, x+1, 2x 하지만 x-1, x+1 의 경우는 시간이 1초가 걸리고 2x 는 0초가 걸린다. 즉 다익스트라 알고리즘을 사용하여 문제를 풀 수 있다. ( 각 경우로 갈 시간이 같다면 Bfs로 풀 수 있다. ) import heapq import math n, k = map(int, input().split(' ')) dist = [math.inf] * 100001 dx = [-1, 1, 2] p_queue = list() def dijkstra(start): dist[start] = 0 heapq.heappush(p_queue, (dist[start], start)) while p_queue: pop_dist, pop_vertex = heapq.hea..
알고리즘/백준
2021. 4. 17. 21:20