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
- re.split
- 백준 16719
- 백준
- Spring
- MSA
- spring security
- java
- 파이썬
- 백준 15685
- java 기술면접
- 웹어플리케이션 서버
- spring oauth
- 백준 17626
- 프로래머스
- 백준 파이썬
- spring cloud
- Coroutine
- with recursive
- 백준 16236
- MySQL
- Kotlin
- Spring Boot
- JVM
- JPA
- 프로그래머스
- springboot
- 백준 16235
- 백준 17779
- sql 기술면접
- 백준 19238
Archives
- Today
- Total
목록백준 13549 (1)
시작이 반
[백준] 13549번 (python 파이썬)
수빈이가 다음 장소로 갈 경우는 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