분류 전체보기 240

baekjun 9252. LCS2

Longest Common Sequence 메트릭스를 만들고 역으로 올라가서 LCS 문자열을 구하는 문제 1234567891011121314151617181920212223242526272829303132333435#include #include #include using namespace std; int strBoard[1001][1001];string s1;string s2;string getLCS(int i, int j) { if (strBoard[i][j] == 0) return ""; while (strBoard[i][j] == strBoard[i - 1][j]) i--; while (strBoard[i][j] == strBoard[i][j - 1]) j--; return getLCS(i - 1..