목록2025/02/23 (2)
넘치게 채우기
https://www.acmicpc.net/problem/1477BOJ - 휴게소 세우기문제 유형: 이진 탐색, 매개변수 탐색(parametric search)문제 난이도: Gold IV시간 제한: 2초메모리 제한: 128MB 문제다솜이는 유료 고속도로를 가지고 있다. 다솜이는 현재 고속도로에 휴게소를 N개 가지고 있는데, 휴게소의 위치는 고속도로의 시작으로부터 얼만큼 떨어져 있는지로 주어진다. 다솜이는 지금 휴게소를 M개 더 세우려고 한다.다솜이는 이미 휴게소가 있는 곳에 휴게소를 또 세울 수 없고, 고속도로의 끝에도 휴게소를 세울 수 없다. 휴게소는 정수 위치에만 세울 수 있다.다솜이는 이 고속도로를 이용할 때, 모든 휴게소를 방문한다. 다솜이는 휴게소를 M개 더 지어서 휴게소가 없는 구간의 길이의 ..
https://leetcode.com/problems/construct-binary-tree-from-preorder-and-postorder-traversal/description/leetcode - Construct Binary Tree from Preorder and Postorder Traversal문제 유형: 트리, 분할 정복문제 난이도: Medium 문제Given two integer arrays, preorder and postorder where preorder is the preorder traversal of a binary tree of distinct values and postorder is the postorder traversal of the same tree, reconstr..