Problem "WPUZZLE" on spoj -Aho-corasick

Правка en3, от akibk001, 2019-02-04 17:14:15

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

Теги aho-corasick, #spoj

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский akibk001 2019-02-04 17:14:15 6 Tiny change: '/WPUZZLES/\nhttps://' -> '/WPUZZLES/ \nhttps://'
en2 Английский akibk001 2019-02-04 17:13:45 7
en1 Английский akibk001 2019-02-04 17:13:03 621 Initial revision (published)