Problem "WPUZZLE" on spoj -Aho-corasick

Revision en2, by akibk001, 2019-02-04 17:13:45

I'm solving wpuzzle problem on spoj . I'm using Aho-corasick algorithm. My idea is keep original patterns as well as reverse the patterns and store them. And using both of these two create a trie and traverse the matrix four times in different ways : 1.left to right traversal 2.up to down traversal 3.diagonally and all the patterns found will be stored. But it is giving me WA. Can you tell the problem in this method. Any failing test cases?? question and my code link.. https://www.spoj.com/problems/WPUZZLES/ https://github.com/mohd-akib/spoj/blob/master/wordpuzzles.cpp

Tags aho-corasick, #spoj

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English akibk001 2019-02-04 17:14:15 6 Tiny change: '/WPUZZLES/\nhttps://' -> '/WPUZZLES/ \nhttps://'
en2 English akibk001 2019-02-04 17:13:45 7
en1 English akibk001 2019-02-04 17:13:03 621 Initial revision (published)