DP on trie

Revision en1, by noobinho, 2018-08-06 09:22:15

I'm trying to do this problem: http://acm.timus.ru/problem.aspx?space=1&num=1455. It gives a dictionary consisting of 'n' words (1 <= n <= 100). Each word consists of from 1 to 100 small latin letters. It's demanded to find an expression which can be formed by at least two different sequences of words from the dictionary. The expression should not be more than 20000 characters long. If the problem has several solutions, you may output any of them. I've heard that it's possible to solve with a dp on the trie that contains the words from the dictionary, but I still didn't realize how to do that after a lot of time thinking. Any help would be appreciated. Thanks in advance.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English noobinho 2018-08-08 10:18:34 5 Tiny change: 'trying to do this prob' -> 'trying to solve this prob'
en2 English noobinho 2018-08-08 10:16:23 208
en1 English noobinho 2018-08-06 09:22:15 689 Initial revision (published)