문제 링크입니다: https://www.acmicpc.net/problem/5582http://jaimemin.tistory.com/370과 유사한 문제였습니다.LCS 문제 같은 경우 부분문자열이 연속하지 않아도 되지만 해당 문제는 연속하는 부분문자열이여야 했으므로 고려해야하는 부분이 추가되어 cache를 3차배열로 잡았습니다.현재 이어나가는 부분문자열이 존재하는지 여부를 판별하기 위해 bool head를 선언하였고 나머지는 LCS 문제와 똑같이 탐색을 진행하면 됩니다. #include #include #include #include using namespace std; const int MAX = 4000; string str1, str2; int cache[2][MAX][MAX]; int longes..