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
- 재귀
- 조합
- 다익스트라
- 트라이
- 우선순위큐
- 투포인터
- 부분집합
- 백트래킹
- 구현
- dfs
- 자료구조
- 이분탐색
- 그리디
- upperbound
- Dijkstra
- 세그먼트트리
- 시뮬레이션
- 회원가입
- BFS
- Floyd
- 플로이드워셜
- 비트마스킹
- dp
- PriorityQueue
- Union Find
- LowerBound
- 이진트리
- 카카오
- Django
- 순열
Archives
- Today
- Total
목록PriorityQueue (1)
J

풀이 방법 PriorityQueue를 사용하여 String이 사전 순으로 계속 정렬되게 한다. 가지치기를 하면서 poll 값을 조사할지 말지 결정한다. 도착 위치와 현재 위치 거리가 남은 거리보다 크면 절대 도착할 수 없다. (현재 위치와 도착 위치 사이 거리)와 남은 거리의 홀짝은 같아야 한다. import java.io.*; import java.util.*; class Solution { static class load{ int x; int y; int time; String route; load(int x, int y, int time, String route){ this.x = x; this.y = y; this.time = time; this.route = route; } public Stri..
🔑 Problem Solving/🍫 Programmers
2023. 5. 8. 13:57