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

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

Need some help in this problem. I'm doing this problem using Tries + DFS + DP. My dp[i] basically stores number of different phrases from ith index to n-1th index. So the final result would be stored in dp[0]. My approach seems to be correct i guess but still i'm getting wrong answer. Here is the link to the problem -> http://www.spoj.com/problems/MORSE/ Here is the link to my code -> http://ideone.com/qmIMKm

Полный текст и комментарии »

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

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

I'm facing problem with this question. I'm getting TLE on test case 19th. I'm doing this question using Tries. Complexity of my code is O(3 * total length of input) which is no where close to getting TLE. Here is my code : http://ideone.com/uNbDf9. Please help

Полный текст и комментарии »

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