题目来源:HDU 3613 Best Reward题意:每一个字母相应一个权值 将给你的字符串分成两部分 假设一部分是回文 这部分的值就是每一个字母的权值之和 求一种分法使得2部分的和最大思路:考虑扩展KMP 输出a串 得到a的反串b 求出f[0]和f[1] 和 extend[0]和extend[1...
分类:
其他好文 时间:
2014-09-11 13:44:31
阅读次数:
186
链接:http://poj.org/problem?id=1699
题意:给出n个字符串,求他们相连的最小长度,如果首尾字母相同则可以共用相同部分,比如两个串ABCDEF和DEFGHI,他们相连为ABCDEFGHI,最小长度为9,中间的DEF部分共用了。
思路:由于数据量较小,首先对每两个字符串a,b用扩展KMP求出a连在b之后可以共用的长度,用数组B[i][j]表示第j个字符串连接在...
分类:
其他好文 时间:
2014-09-11 02:19:21
阅读次数:
210
FJ打算带着他可爱的N (1 ≤ N ≤ 2,000)头奶牛去参加”年度最佳老农”的比赛.在比赛中,每个农夫把他的奶牛排成一列,然后准备经过评委检验. 比赛中简单地将奶牛的名字缩写为其头字母(the initial letter of every cow),举个例子,FJ带了Bessie, Sylv...
分类:
其他好文 时间:
2014-09-10 23:41:41
阅读次数:
237
看来从版本3.3.1基本上已经支持线程句柄的传递功能。具体限制我标记了一下。(6) Is SQLite threadsafe?SQLite is threadsafe. We make this concession since many users choose to ignore the adv...
分类:
移动开发 时间:
2014-09-10 13:54:50
阅读次数:
558
第一章: 1.时间估算。 2.“抽签”优化 3.Ants Poj 1852的思考过程第二章: 1.next_permutation函数 2.栈内存和堆内存——关于内存抽象。 * 3.Best Cow Line Poj 3617 * 4.霍夫曼编码 5.01背包的空间优化 6.memse...
分类:
其他好文 时间:
2014-09-10 12:05:50
阅读次数:
249
[leetcode]Best Time to Buy and Sell Stock III...
分类:
其他好文 时间:
2014-09-09 13:31:08
阅读次数:
128
[leetcode]Best Time to Buy and Sell Stock...
分类:
其他好文 时间:
2014-09-09 13:30:58
阅读次数:
202
[leetcode]Best Time to Buy and Sell Stock II...
分类:
其他好文 时间:
2014-09-09 13:30:48
阅读次数:
121
Tags: wigs for women, best wigs for womenPointers To Consider When Looking For The Ideal Ohio Automotive Refinishing Detection Company By: tysoncross0...
分类:
其他好文 时间:
2014-09-09 12:28:18
阅读次数:
262
Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie,...
分类:
其他好文 时间:
2014-09-08 09:39:06
阅读次数:
312