목록2024/12/27 (2)
넘치게 채우기
https://www.acmicpc.net/problem/9252BOJ - LCS 2문제 유형: LCS(Longest Common Subsequence), 다이나믹 프로그래밍, 문자열처리문제 난이도: Gold IV시간 제한: 1초메모리 제한: 256MB 문제LCS(Longest Common Subsequence, 최장 공통 부분 수열)문제는 두 수열이 주어졌을 때, 모두의 부분 수열이 되는 수열 중 가장 긴 것을 찾는 문제이다.예를 들어, ACAYKP와 CAPCAK의 LCS는 ACAK가 된다. 입력첫째 줄과 둘째 줄에 두 문자열이 주어진다. 문자열은 알파벳 대문자로만 이루어져 있으며, 최대 1000글자로 이루어져 있다. 출력첫째 줄에 입력으로 주어진 두 문자열의 LCS의 길이를, 둘째 줄에 LCS를 출력..
https://leetcode.com/problems/best-sightseeing-pair/description/leetcode - Best Sightseeing Pair문제 유형: 그리디, 다이나믹 프로그래밍문제 난이도: Medium 문제You are given an integer array values where values[i] represents the value of the ith sightseeing spot. Two sightseeing spots i and j have a distance j - i between them.The score of a pair (i values[i] + values[j] + i - j: the sum of the values of the sightseein..