목록2025/02/02 (2)
넘치게 채우기
https://www.acmicpc.net/problem/2098BOJ - 외판원 순회문제 유형: TSP(외판원 순회), 비트마스킹, 다이나믹 프로그래밍, dfs문제 난이도: Gold I시간 제한: 1초메모리 제한: 128MB 문제외판원 순회 문제는 영어로 Traveling Salesman problem (TSP) 라고 불리는 문제로 computer science 분야에서 가장 중요하게 취급되는 문제 중 하나이다. 여러 가지 변종 문제가 있으나, 여기서는 가장 일반적인 형태의 문제를 살펴보자.1번부터 N번까지 번호가 매겨져 있는 도시들이 있고, 도시들 사이에는 길이 있다. (길이 없을 수도 있다) 이제 한 외판원이 어느 한 도시에서 출발해 N개의 도시를 모두 거쳐 다시 원래의 도시로 돌아오는 순회 여행 ..
https://leetcode.com/problems/check-if-array-is-sorted-and-rotated/description/leetcode - Check if Array Is Sorted and Rotated문제 유형: 배열, 구현문제 난이도: Easy 문제Given an array nums, return true if the array was originally sorted in non-decreasing order, then rotated some number of positions (including zero). Otherwise, return false.There may be duplicates in the original array.Note: An array A rotated ..