题目链接:hdu 4960 Another OCD Patient
题目大意:给定一个长度为n的序列,然后再给出n个数ai,表示合成i个数的代价。每次可以将连续的子序列和成一个数,即为序列中各个项的和。要求将给定长度n的序列变成一个回文串,一个数字只能被合成一次。
解题思路:dp[l][r]表示从l到r被和成回文串的最小代价,dp[l][r]=min(val(r?l+1),val(r?...
分类:
其他好文 时间:
2014-08-20 00:06:35
阅读次数:
205
1, InterruptInterruption in Java is not pre-emptive. Put another way both threads have to cooperate in order to process the interrupt properly. If the...
分类:
编程语言 时间:
2014-08-19 23:46:45
阅读次数:
235
Another OCD PatientProblem DescriptionXiaoji is an OCD (obsessive-compulsive disorder) patient. This morning, his children played with plasticene. The...
分类:
其他好文 时间:
2014-08-19 23:45:55
阅读次数:
259
区间dp。。
T^T一直感觉是n^3,看了题解看来是数据水了么。。
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include
#include
#define ll long long
#define inf 1e8
inline int min(int a, int b){return a<b?a:b;}...
分类:
其他好文 时间:
2014-08-19 20:57:15
阅读次数:
213
HDU 4960 Another OCD Patient
题意:给你一串数字 相邻x个数字合并成一个数字(相加)有一定代价 问 最少花费多少使得串变成回文串
思路:
读完题感觉像dp 数据范围也像 就开始想怎么表示状态 最简单的应该想到dp[i][j]表示i到j区间变成回文串的最小花费 状态想好了想做法 考虑将串分成AAAABBBBBBBCCC三段 即所有A合成一个数字 ...
分类:
其他好文 时间:
2014-08-19 20:52:45
阅读次数:
342
题目:poj 1458 Common Subsequence
Description
A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a...
分类:
其他好文 时间:
2014-08-19 19:04:25
阅读次数:
182
Another OCD Patient
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 87 Accepted Submission(s): 24
Problem Description
Xiaoji i...
分类:
其他好文 时间:
2014-08-19 19:03:55
阅读次数:
300
Problem Description
Kingdom Rush is a popular TD game, in which you should build some towers to protect your kingdom from monsters. And now another wave of monsters is coming and you need again to kn...
分类:
其他好文 时间:
2014-08-19 19:02:35
阅读次数:
252
Evaluate the value of an arithmetic expression in Reverse Polish Notation.
Valid operators are +, -, *, /.
Each operand may be an integer or another expression.
Some examples:
["2", "1", ...
分类:
其他好文 时间:
2014-08-18 18:42:42
阅读次数:
215
Air Raid
Problem Description
Consider a town where all the streets are one-way and each street leads from one intersection to another. It is also known that starting from an intersection and wal...
分类:
其他好文 时间:
2014-08-15 21:13:29
阅读次数:
407