Need help on DFS problem on SPOJ

Правка en1, от Hd7, 2019-09-13 08:38:28

I am trying to solve ABC Path problem on SPOJ. I don't know where i missed. Why SPOJ don't give me test cases which my code is wrong on. Could you help me figure out it.
My code
Idea:
$$$dp[i][j]$$$: The longest consecutive sequence when we start at character $$$(i,j)$$$.
I use DFS to compute dp table.
After that, I iterate all characters $$$c[i][j]$$$ in the matrix, if c[i][j]=='A', I take the answer ans = max(ans, dp[i][j]).
Thank you!!!

Теги #dfs and similar

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Hd7 2019-09-13 08:38:28 556 Initial revision (published)