2011年12月31日

SRM528 DIV2 解题报告

摘要: 250pt:关于回文串的题。首先对称着看,如果对称的两端都是‘?’,那么选花费较小的一种字母替换即可(关键在于费用,字符串中只要标记一下就行了),如果两端只有一个问号,那么花费是确定的,根据对称的另一端累加最小花费#include <iostream>#include <cstdio>#include <cstdlib>#include <string>using namespace std;typedef long long llg;class MinCostPalindrome{public: int getMinimum(string s, 阅读全文

posted @ 2011-12-31 10:37 Moon_1st 阅读(161) 评论(0) 推荐(0) 编辑

导航