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

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

I need help to solve SPOJ — BUILDING

I can solve it in O( total h_i * 2 * log(m) ). But it is not enough to get Accepted.

How can i optimize complexity?

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

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

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

Need some help to solve Very Dirty String problem.

Short Description:

Given three strings A, B and C. Find the longest common sub-sequence of A and B, which have C at-least once as a substring in it.

Input: There will be T test cases. For each test there will be three lines describing string A, B, and C.

Constraints: 1 ≤ T ≤ 100 1 ≤ |A|, |B|, |C| ≤ 100

My approach: I tried it using normal recursive LCS with extra another state pointing the index of string C i'm trying to match.

here is my code.

Sorry for my bad English.

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

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