목록2024/11/25 (2)
넘치게 채우기
https://www.acmicpc.net/problem/11779BOJ - 최소비용 구하기 2문제 유형: 최단 거리, 다익스트라, 유니온-파인드문제 난이도: Gold III시간 제한: 1초메모리 제한: 256MB 문제n(1≤n≤1,000)개의 도시가 있다. 그리고 한 도시에서 출발하여 다른 도시에 도착하는 m(1≤m≤100,000)개의 버스가 있다. 우리는 A번째 도시에서 B번째 도시까지 가는데 드는 버스 비용을 최소화 시키려고 한다. 그러면 A번째 도시에서 B번째 도시 까지 가는데 드는 최소비용과 경로를 출력하여라. 항상 시작점에서 도착점으로의 경로가 존재한다. 입력첫째 줄에 도시의 개수 n(1≤n≤1,000)이 주어지고 둘째 줄에는 버스의 개수 m(1≤m≤100,000)이 주어진다. 그리고 셋째 줄..
https://leetcode.com/problems/sliding-puzzle/description/leetcode - Sliding Puzzle문제 유형: bfs문제 난이도: Hard 문제On an 2 x 3 board, there are five tiles labeled from 1 to 5, and an empty square represented by 0. A move consists of choosing 0 and a 4-directionally adjacent number and swapping it.The state of the board is solved if and only if the board is [[1,2,3],[4,5,0]].Given the puzzle board board,..