hdu 5495 LCS 水题 LCS

Time Limit: 1 Sec  

Memory Limit: 256 MB

题目连接

http://acm.hdu.edu.cn/showproblem.php?pid=5495

Description

你有两个序列{a_1,a_2,...,a_n}{a1​​,a2​​,...,an​​}和{b_1,b_2,...,b_n}{b1​​,b2​​,...,bn​​}. 他们都是11到nn的一个排列. 你需要找到另一个排列{p_1,p_2,...,p_n}{p1​​,p2​​,...,pn​​}, 使得序列{a_{p_1},a_{p_2},...,a_{p_n}}{ap1​​​​,ap2​​​​,...,apn​​​​}和