动态规划之区间DP
等我学会后缀自动机
侠影之谜
展开
-
UVA 1626 Brackets sequence ( 矩形dp+输入输出细节 )
Let us define a regular brackets sequence in the following way: 1. Empty sequence is a regular sequence. 2. If S is a regular sequence, then (S) and [S] are both regular sequences. 3. If A and B are r...原创 2018-07-03 06:14:58 · 278 阅读 · 0 评论 -
UVA 10003 Cutting Sticks (矩乘类dp,裸题)
You have to cut a wood stick into pieces. The most affordable company, The Analog Cutting Machinery, Inc. (ACM), charges money according to the length of the stick being cut. Their procedure of work re...原创 2018-06-28 07:31:29 · 212 阅读 · 0 评论 -
ZOJ 1276 Optimal Array Multiplication Sequence(简单dp问题+路径打印)
Optimal Array Multiplication Sequence Time Limit: 2 Seconds Memory Limit: 65536 KB ...原创 2018-07-13 12:16:20 · 184 阅读 · 0 评论 -
Codeforces Round #538 (Div. 2) D. Flood Fill(区间DP)
题目链接:http://codeforces.com/contest/1114/problem/D题目大意:给定一个数字序列,规定连通区域为数字相同且位置连续的一个块,然后初始可以指定一个位置且位置固定,可以操作把当前连通块的颜色变化,问要把序列变成一个连通块,其最小操作数是多少。题目分析:本来我是想用数据结构来维护的,因为我发现,一个位置被括号数字对包含了多少次其变色次数就...原创 2019-02-14 18:09:01 · 326 阅读 · 2 评论