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 |
Tags
- sql 기술면접
- MySQL
- 백준 17626
- 백준 19238
- JPA
- 백준 16235
- Spring Boot
- Spring
- spring cloud
- JVM
- 백준 16719
- 파이썬
- Kotlin
- springboot
- spring security
- spring oauth
- 프로래머스
- Coroutine
- MSA
- 웹어플리케이션 서버
- 백준 15685
- 백준 17779
- with recursive
- 백준 파이썬
- re.split
- 백준
- 프로그래머스
- java
- 백준 16236
- java 기술면접
Archives
- Today
- Total
목록백준 13549 (1)
시작이 반
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/ezYfKM/btq2Ny1WDl0/zo94751EmcHLzKKcTmThY0/img.png)
수빈이가 다음 장소로 갈 경우는 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