Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
の繰り返しlcsは次のとおりです。
lcs
L[i,j] = max(L[i-1,j], L[i,j-1]) if a[i] != a[j]
それがなぜなのか教えていただけますi-1かj-1?なぜL[i,j] = L[i-1,j-1]正しくないのですか?
i-1
j-1
L[i,j] = L[i-1,j-1]