P2543 [AHOI2004] Strange String

Description

![](https://cdn.luogu.com.cn/upload/pic/1654.png)

Input Format

The input file contains two strings X and Y. Both strings consist only of 0 and 1. The length of each string is less than 9999.

Output Format

Output the length of the longest common subsequence of X and Y.

Explanation/Hint

Translated by ChatGPT 5