9251번: LCS https://www.acmicpc.net/problem/9251 9251번: LCS LCS(Longest Common Subsequence, 최장 공통 부분 수열)문제는 두 수열이 주어졌을 때, 모두의 부분 수열이 되는 수열 중 가장 긴 것을 찾는 문제이다. 예를 들어, ACAYKP와 CAPCAK의 LCS는 ACAK가 된다. www.acmicpc.net 코드 #include #include using namespace std; int dp[1001][1001]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); string str1, str2; cin >> str1; cin >> str2; for (int i = 1; i