随笔分类 -  动态规划 区间dp

摘要:QSC and Master Problem Description Every school has some legends, Northeastern University is the same.Enter from the north gate of Northeastern Univer 阅读全文
posted @ 2016-09-18 19:20 meekyan 阅读(843) 评论(0) 推荐(5)
摘要:Dire Wolf Problem Description Dire wolves, also known as Dark wolves, are extraordinarily large and powerful wolves. Many, if not all, Dire Wolves app 阅读全文
posted @ 2016-07-08 21:43 meekyan 阅读(183) 评论(0) 推荐(0)
摘要:题目连接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=19461 Game of sum Description This is a two player game. Initially there are n intege 阅读全文
posted @ 2016-06-20 16:27 meekyan 阅读(191) 评论(0) 推荐(0)
摘要:D Game Problem Description 众所周知,度度熊喜欢的字符只有两个:B 和D。今天,它发明了一个游戏:D游戏。度度熊的英文并不是很高明,所以这里的D,没什么高深的含义,只是代指等差数列[(等差数列百科)](http://baike.baidu.com/view/62268.ht 阅读全文
posted @ 2016-05-22 22:06 meekyan 阅读(692) 评论(2) 推荐(0)
摘要:题目链接: http://bestcoder.hdu.edu.cn/contests/contest_show.php?cid=701 1001 : 矩阵快速幂 #include <iostream> #include <algorithm> #include <cstdio> #include < 阅读全文
posted @ 2016-05-21 17:51 meekyan 阅读(793) 评论(2) 推荐(3)
摘要:先来个板子 最长公共子序列问题: 给定2个字符串,求其最长公共子串。如abcde和dbada的最长公共字串为bd。 动态规划:dp[i][j]表示A串前i个和B串前j个的最长公共子串的长度。 则 若A[i] == B[j] , dp[i][j] = dp[i-1][j-1] + 1; 否则 dp[i 阅读全文
posted @ 2016-05-01 22:48 meekyan 阅读(984) 评论(0) 推荐(0)
摘要:Folding Description Bill is trying to compactly represent sequences of capital alphabetic characters from `A' to `Z' by folding repeating subsequences 阅读全文
posted @ 2016-04-26 22:07 meekyan 阅读(318) 评论(0) 推荐(0)
摘要:1260: [CQOI2007]涂色paint Description 假设你有一条长度为5的木版,初始时没有涂过任何颜色。你希望把它的5个单位长度分别涂上红、绿、蓝、绿、红色,用一个长度为5的字符串表示这个目标:RGBGR。 每次你可以把一段连续的木版涂成一个给定的颜色,后涂的颜色覆盖先涂的颜色。 阅读全文
posted @ 2016-03-10 22:34 meekyan 阅读(583) 评论(0) 推荐(0)
摘要:Archaeologists have discovered a new set of hidden caves in one of the Egyptian pyramids. The decryption of ancient hieroglyphs on the walls nearby sh... 阅读全文
posted @ 2015-12-28 21:46 meekyan 阅读(245) 评论(0) 推荐(0)
摘要:Sit sit sit问题描述在一个XX大学中有NN张椅子排成一排,椅子上都没有人,每张椅子都有颜色,分别为蓝色或者红色。 接下来依次来了NN个学生,标号依次为1,2,3,...,N。 对于每个学生,他会找一张还没有人坐的椅子坐下来。但是如果这张椅子满足以下三个条件他就不会去坐。1. 这张椅子左右两... 阅读全文
posted @ 2015-12-25 16:20 meekyan 阅读(179) 评论(0) 推荐(0)
摘要:D. ZumaGenos recently installed the game Zuma on his phone. In Zuma there exists a line ofngemstones, thei-th of which has colorci. The goal of the ga... 阅读全文
posted @ 2015-12-24 16:43 meekyan 阅读(308) 评论(0) 推荐(0)
摘要:1055: [HAOI2008]玩具取名Time Limit: 10 SecMemory Limit: 162 MBSubmit: 1144Solved: 668[Submit][Status][Discuss]Description某人有一套玩具,并想法给玩具命名。首先他选择WING四个字母中的任... 阅读全文
posted @ 2015-09-10 14:45 meekyan 阅读(270) 评论(0) 推荐(0)