
动态-状态压缩
IT-LittleM
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
UVA11464-Even Parity
We have a grid of size N × N. Each cell of the grid initially contains a zero(0) or a one(1). The parityof a cell is the number of 1s surrounding that cell. A cell is surrounded by at most 4 cells (top, bottom,left, right).Suppose we have a grid of size原创 2020-09-26 12:29:30 · 171 阅读 · 0 评论 -
POJ1185-炮兵阵地(状态压缩)
司令部的将军们打算在NM的网格地图上部署他们的炮兵部队。一个NM的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示:如果在地图中的灰色所标识的平原上部署一支炮兵部队,则图中的黑色的网格表示它能够攻击到的区域:沿横向左右各两格,沿纵向上下各两格。图上其它白色网格均攻击不到。从图上可见炮兵的攻击范围不受地形的影响。现在,将军们规划如何部原创 2020-05-27 20:36:37 · 280 阅读 · 0 评论 -
HDU4539-郑厂长系列故事——排兵布阵
郑厂长不是正厂长 也不是副厂长 他根本就不是厂长 事实上 他是带兵打仗的团长一天,郑厂长带着他的军队来到了一个nm的平原准备布阵。 根据以往的战斗经验,每个士兵可以攻击到并且只能攻击到与之曼哈顿距离为2的位置以及士兵本身所在的位置。当然,一个士兵不能站在另外一个士兵所能攻击到的位置,同时因为地形的原因平原上也不是每一个位置都可以安排士兵。 现在,已知n,m 以及平原阵地的具体地形,请你帮助郑厂长计算该阵地,最多能安排多少个士兵。Input输入包含多组测试数据;每组数据的第一行原创 2020-05-26 20:36:54 · 461 阅读 · 0 评论 -
HDU3182-Hamburger Magi(状态压缩)
In the mysterious forest, there is a group of Magi. Most of them like to eat human beings, so they are called “The Ogre Magi”, but there is an special one whose favorite food is hamburger, having been jeered by the others as “The Hamburger Magi”.Let’s giv原创 2020-05-23 22:03:26 · 337 阅读 · 0 评论 -
HDU2167-Pebbles(状态压缩)
You’re given an unlimited number of pebbles to distribute across an N x N game board (N drawn from [3, 15]), where each square on the board contains some positive point value between 10 and 99, inclusive. A 6 x 6 board might look like this:The player dis原创 2020-05-20 15:23:53 · 290 阅读 · 0 评论 -
HDU1074-Doing Homework(状态压缩)
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 the deadline, the teacher will reduce his score of the fin原创 2020-05-18 19:19:49 · 274 阅读 · 0 评论 -
HDU3001-Travelling(三进制+状态压缩)
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 his start station because superman can bring him to any原创 2020-05-17 16:23:08 · 204 阅读 · 0 评论 -
POJ3254-Corn Fields(状态压缩)
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, some of the squares are infertile and can’t be planted.原创 2020-05-16 16:15:37 · 145 阅读 · 0 评论 -
POJ1170-Shopping Offers(状态压缩)
In a shop each kind of product has a price. For example, the price of a flower is 2 ICU (Informatics Currency Units) and the price of a vase is 5 ICU. In order to attract more customers, the shop int...原创 2020-04-06 15:20:19 · 357 阅读 · 0 评论