This repository was archived by the owner on Mar 18, 2024. It is now read-only.
[2023-09-11] wooyeol #205#219
Merged
Merged
Conversation
Closed
limstonestone
approved these changes
Sep 11, 2023
Contributor
limstonestone
left a comment
There was a problem hiding this comment.
저도 해당 문제 풀이에 실패했는데 다음 번에는 꼭 풀 수 있었으면 좋겠네요 ㅎㅎ
수고 많으셨습니다!!!!
zsmalla
approved these changes
Sep 11, 2023
Contributor
zsmalla
left a comment
There was a problem hiding this comment.
굳! 메트릭스를 그리더라도 풀이 참조의 블로그 설명처럼 각 셀이 어떤 것을 의미하는 지에 초점을 두고 접근하면 더 이해가 쉬울 것입니다. 고생하셨어요!
Contributor
|
충분히 고민하시고, 풀이 보시면서도 이해 안되는 부분을 정확히 다 짚고 넘어가셨으니까 우열님이라면 다음 번엔 무조건 푸실거에요!! 고생하셨습니다 :) |
ksumini
approved these changes
Sep 11, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
LCS
https://www.acmicpc.net/problem/9251
풀이 참조 : https://velog.io/@emplam27/알고리즘-그림으로-알아보는-LCS-알고리즘-Longest-Common-Substring와-Longest-Common-Subsequence
풀이시간
13:22 ~ 14:22(1시간 고민 후 풀이 참고)
문제 조건
문자열의 최대 길이는 1000
시간 복잡도 :
O(N * N) = O(N^2)
접근법
무슨 알고리즘으로 풀이 할 수 있을까? -> DP
점화식:
1. 문자열A, 문자열B의 한글자씩 비교해봅니다.
2. 두 문자가 다르다면 LCS[i - 1][j]와 LCS[i][j - 1] 중에 큰값을 표시합니다.
3. 두 문자가 같다면 LCS[i - 1][j - 1] 값을 찾아 +1 합니다.
4. 위 과정을 반복합니다.