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

Автор aajjbb, 13 лет назад, По-английски

Hello.

I'm trying to solve Palindromic Paths Link. Given a graph with letters in the edges, find longest and smallest palindrome from vertex 0 to vertex N — 1. My current solution based on a backtracked dfs easily exceed the time limits, do someone know a faster way to find it ?

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

»
13 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

Think about DP solution

»
13 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I finally solved this problem, thank you so much, I appreciate your help. By the way, I recommend this problem to anyone who's looking for better knowledge on dynamic programming with strings.