摘要:
http://poj.org/problem?id=1080题意:已知一个人类基因的积分表,给出两个字符串,计算这两个串的最大相似程度;思路:最长公共子序列的变形,用score[][] 表示积分值,dp[i][j]表示字符串s1[1,2,,,i]和s2[1,2,,,j]的分值,对一个dp[i][j],有三种可能:> s1取第i个字符,s2取‘-’时,dp[i][j] = dp[i-1][j] + score[s1[i]][0];>s1取‘-’,s2取第j个字符时,dp[i][j] = dp[i][j-1] + score[0][s2[j]];>s1取第i个字符,s2取第j个字 阅读全文
摘要:
Time Limit:3000MSMemory Limit:65536KTotal Submissions:48526Accepted:16674DescriptionA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines the minimal number of characters 阅读全文