
动态规划-状压DP
动态规划
Stephencurry‘s csdn
这个作者很懒,什么都没留下…
展开
-
Permutation(HDU-3811)(状压DP)
In combinatorics a permutation of a set S with N elements is a listing of the elements of S in some order (each element occurring exactly once). There are N! permutations of a set which has N elements...原创 2020-03-14 11:13:36 · 215 阅读 · 0 评论 -
郑厂长系列故事——排兵布阵(HDU-4539)(状压DP)
郑厂长不是正厂长 也不是副厂长 他根本就不是厂长 事实上 他是带兵打仗的团长 一天,郑厂长带着他的军队来到了一个n*m的平原准备布阵。 根据以往的战斗经验,每个士兵可以攻击到并且只能攻击到与之曼哈顿距离为2的位置以及士兵本身所在的位置。当然,一个士兵不能站在另外一个士兵所能攻击到的位置,同时因为地形的原因平原上也不是每一个位置都可以安排士兵。 现在,已知n,m 以及...原创 2020-03-12 11:22:35 · 405 阅读 · 0 评论 -
God of War(HDU-2809)(状压DP)
At 184~280 A.D ,there were many kingdoms in China. Three strongest among them are "Wei", "Shu", "Wu". People call this period as "Three Kingdoms".HH is a super "Three Kingdoms" fan, because at this p...原创 2020-03-09 15:04:50 · 278 阅读 · 0 评论 -
Hie with the Pie(POJ-3311)(状压DP+Floyd)
The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hire only one driver to do the deliveries. He will wait ...原创 2020-03-07 16:46:57 · 194 阅读 · 0 评论 -
Imperishable Night(HDU-3001)(状压DP+三进制)
After coding so many days,Mr Acmer wants to have a good rest.So travelling is the best choice!He has decided to visit n cities(he insists on seeing all the cities!And he does not mind which city being...原创 2020-03-07 11:15:15 · 183 阅读 · 0 评论 -
Corn Fields(POJ-3254)(状压DP)
Farmer John has purchased a lush new rectangular pasture composed ofMbyN(1 ≤M≤ 12; 1 ≤N≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regrettably, ...原创 2020-03-06 17:34:12 · 178 阅读 · 0 评论 -
Relocation(POJ-2923)(状压DP+01背包)
Emma and Eric are moving to their new house they bought after returning from their honeymoon. Fortunately, they have a few friends helping them relocate. To move the furniture, they only have two comp...原创 2020-03-03 10:55:16 · 221 阅读 · 0 评论 -
Help Bubu(HDU-3237)(状压DP)
Bubu's bookshelf is in a mess! Help him!There arenbooks on his bookshelf. We define the mess value to be the number of segments ofconsecutive equal-height books. For example, if the book heights a...原创 2020-03-02 16:12:53 · 305 阅读 · 0 评论 -
LianLianKan(HDU-4272)(状压DP)
I like playing game with my friend, although sometimes looks pretty naive. Today I invent a new game called LianLianKan. The game is about playing on a number stack.Now we have a number stack, and we...原创 2020-02-29 11:08:47 · 232 阅读 · 2 评论 -
钥匙计数之一 (HDU-1438)(状压DP)
一把锁匙有N个槽,槽深为1,2,3,4。每锁匙至少有3个不同的深度且至少有1对相连的槽其深度之差为3。求这样的锁匙的总数。Input本题无输入Output对N>=2且N<=31,输出满足要求的锁匙的总数。Sample OutputN=2: 0N=3: 8N=4: 64N=5: 360..............N=31: ...注:...原创 2020-02-27 11:24:56 · 208 阅读 · 0 评论 -
Hackers' Crackdown(UVA-11825)(状压DP+枚举子集)
题意:假设你是一个黑客, 侵入了一个有着n台计算机(编号为0,1,…,n-1) 的网络。 一共有n种服务,每台计算机都运行着所有服务。对于每台计算机,你都可以选择一项服务, 终止这台计算机和所有与它相邻计算机的该项服务(如果其中一些服务已经停止,则这些服务继续处于停止状态)。你的目标是让尽量多的服务器完全瘫痪(即: 没有任何计算机运行该项服务)。思路:这道题的话,要注意的地方是如...原创 2020-02-27 10:22:26 · 208 阅读 · 0 评论 -
炮兵阵地 (POJ-1185)(状压DP)
司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示:如果在地图中的灰色所标识的平原上部署一支炮兵部队,则图中的黑色的网格表示它能够攻击到的区域:沿横向...原创 2020-02-26 10:12:12 · 797 阅读 · 0 评论 -
方格取数(HDU-1565) (状压DP)
给你一个n*n的格子的棋盘,每个格子里面有一个非负数。从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数的和最大。Input包括多个测试实例,每个测试实例包括一个整数n 和n*n个非负数(n<=20)Output对于每个测试实例,输出可能取得的最大的和Sample Input375 15 21 75 15...原创 2020-02-24 11:24:08 · 210 阅读 · 0 评论