Thursday, October 31, 2013

SPOJ 1021. Aibohphobia

This is the problem statement
http://www.spoj.com/problems/AIBOHP/

This problem is similar to the problem Palindrom 2000 (IOIPALIN). This task can be turned into another task. The number of insertions equals to the length of the string minus LCS(longest common subsequence) of the given string and the reversed string of the given string.
formula
answer=n - LCS( string, reversed string)

You can find information about LCS here.

DOWNLOAD FULL SOURCE CODE


2 comments:

  1. cannot download source code.

    ReplyDelete
    Replies
    1. HI. Everything is fine with the link, when you click "Download full source source code" a page pops up which has nothing to do with it, you need to wait for only 5 seconds (you can find the countdown timer on the top right ) , after 5 seconds on the same top right you can find a yellow button , you need to click on it and you will be redirected to the page with the source code/

      Delete