![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
状态dp
sdau20163940
努力学习,天天向上!
展开
-
J - Long Dominoes (状态dp)
Find the number of ways to tile an m*n rectangle with long dominoes -- 3*1 rectangles.Each domino must be completely within the rectangle, dominoes must not overlap (of course, they may touch each o原创 2017-12-09 20:24:47 · 152 阅读 · 0 评论 -
W - 钥匙计数之一 (状态dp)
一把锁匙有N个槽,槽深为1,2,3,4。每锁匙至少有3个不同的深度且至少有1对相连的槽其深度之差为3。求这样的锁匙的总数。Input本题无输入Output对N>=2且NSample OutputN=2: 0N=3: 8N=4: 64N=5: 360..............N=31: ...注:根据Pku Judge Online 1351 Num原创 2017-12-07 00:06:12 · 253 阅读 · 0 评论 -
O - Necklace (状态dp)
One day , Partychen gets several beads , he wants to make these beads a necklace . But not every beads can link to each other, every bead should link to some particular bead(s). Now , Partychen wants原创 2017-12-06 21:18:24 · 180 阅读 · 0 评论 -
M - 方格取数(1) (状态dp)
给你一个n*n的格子的棋盘,每个格子里面有一个非负数。 从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数的和最大。Input包括多个测试实例,每个测试实例包括一个整数n 和n*n个非负数(nOutput对于每个测试实例,输出可能取得的最大的和Sample Input375 15 21 75 15 28 34 7原创 2017-12-06 19:39:51 · 244 阅读 · 0 评论 -
G - Survival (状态dp)
The King of Fighter 97 (KOF97) is an electronic game of wrestling type. Once it was fashionable among youths. The game is amused. However, playing by oneself is not as excited as with friends. Getting原创 2017-12-06 19:27:46 · 143 阅读 · 0 评论 -
C - 炮兵阵地 (状态dp)
题意:类似于上面一道题,一个方格组成的矩阵,每个方格可以放大炮用0表示,不可以放大炮用1表示(原题用字母),让放最多的大炮,大炮与大炮间不会互相攻击。解析:可以发现,对于每一行放大炮的状态,只与它上面一行和上上一行的状态有关,每一行用状态压缩的表示方法,0表示不放大炮,1表示放大炮,同样的,先要满足硬件条件,即有的地方不能放大炮,然后就是每一行中不能有两个1的距离小于2(保证横着不原创 2017-12-03 23:31:02 · 262 阅读 · 0 评论 -
D - Hie with the Pie (状态dp)
分析转自:http://blog.csdn.net/tc_to_top/article/details/43894747题目大意:一个人要送n份货,给出一个矩阵,表示任意两个点间的直接路径的时间,求从起点0送完这n份货(到达指定的n个地点)再回到起点0的最短时间思路:n不大,可以进行状态压缩,首先用Floyd处理一下任意两点的最短路,dp[i][j]表示在状态i的条件下到城市j的最短时原创 2017-12-02 21:18:55 · 210 阅读 · 0 评论 -
A - Mondriaan's Dream (状态dp)
Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series' (where he had to use his toilet paper to draw on, for all of h原创 2017-12-02 17:19:18 · 187 阅读 · 0 评论 -
H - Most Powerful (状态压缩dp)
Recently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of these atoms collide, one of them disappears and a lot of power原创 2017-11-28 23:47:54 · 264 阅读 · 0 评论 -
B - Corn Fields (状态dp)
Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regrettably, s转载 2017-11-29 00:20:26 · 190 阅读 · 0 评论 -
L - Doing Homework (状态dp)
Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the homework after th原创 2017-12-02 11:46:29 · 327 阅读 · 0 评论 -
V - Card Collector (概率dp)
In your childhood, do you crazy for collecting the beautiful cards in the snacks? They said that, for example, if you collect all the 108 people in the famous novel Water Margin, you will win an amazi原创 2017-12-11 00:19:17 · 206 阅读 · 0 评论 -
Q - LianLianKan (模拟)
Q - LianLianKan 地址:点击打开链接题意:给一串数字,从头开始找和他相同的并且距离小于6的删除,问最后能不能删除所有数思路:模拟一遍就好代码:#include #include #include using namespace std;int num[1020];int vis[1010];int main(){ int n;原创 2017-12-10 20:25:02 · 128 阅读 · 0 评论 -
N - Pieces (状态dp)
You heart broke into pieces.My string broke into pieces.But you will recover one day,and my string will never go back. Given a string s.We can erase a subsequence of it if this subsequence is palind原创 2017-12-09 22:22:07 · 262 阅读 · 0 评论 -
K - Tourism Planning (状态dp)
Several friends are planning to take tourism during the next holiday. They have selected some places to visit. They have decided which place to start their tourism and in which order to visit these pl原创 2017-12-07 17:42:34 · 278 阅读 · 0 评论