Скоро Codeforces Round 1133 (Div. 1, Div. 2)! Регистрация здесь. ×

Блог пользователя Hd7

Автор Hd7, история, 7 лет назад, По-английски

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
  • Проголосовать: не нравится

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 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!!