### Hd7's blog

By Hd7, history, 12 months ago,

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!!!

• -4

 » 12 months ago, # |   0 After posting the question, I read my code again and found out the mistake.I used cerr to print the answer. What a stupid me!!
•  » » 12 months ago, # ^ |   0 But at least, that i posted the question helps me figure out it by myself.
•  » » » 12 months ago, # ^ |   0 Lol, you didn't run it for one time and you are happy that you posted this.
•  » » » » 12 months ago, # ^ |   0 I ran it by my local computer, it works perfectly but didn't pass the system tests.
 » 6 weeks ago, # |   0 Hey, can you explain what i'm doing wrong. https://ideone.com/vULGyp