z-algorithm

CF126B Password

by Nick

posted in Z-algorithm

Cho xâu S |S|<=1000.000. Tìm substring P dài nhất của S sao cho P vừa là prefix vừa là suffix vừa xuất hiện ở giữa S (không trùng prefix, suffix) Sample test(s) input fixprefixsuffix output fix input abcdabc output Just a legend Dùng Z-algorithm xấy dựng...

Read more