
动态规划——状压 DP
Alex_McAvoy
想要成为渔夫的猎手
展开
-
Corn Fields(POJ-3254)
Problem DescriptionFarmer 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 ...原创 2018-08-22 10:34:00 · 354 阅读 · 0 评论 -
Pieces(HDU-4628)
Problem DescriptionYou 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 ...原创 2018-10-04 12:02:46 · 242 阅读 · 0 评论 -
Necklace(HDU-3091)
Problem DescriptionOne 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). ...原创 2018-10-04 01:03:08 · 308 阅读 · 0 评论 -
方格取数(1)(HDU-1565)
Problem Description给你一个n*n的格子的棋盘,每个格子里面有一个非负数。从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数的和最大。Input包括多个测试实例,每个测试实例包括一个整数n 和n*n个非负数(n<=20)Output对于每个测试实例,输出可能取得的最大的和Sample In...原创 2018-10-03 23:13:27 · 1146 阅读 · 1 评论 -
Doing Homework(HDU-1074)
Problem DescriptionIgnatius 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...原创 2018-10-03 23:11:23 · 667 阅读 · 0 评论 -
Tourism Planning(HDU-4096)
Problem DescriptionSeveral 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 o...原创 2018-10-02 18:56:01 · 233 阅读 · 0 评论 -
炮兵阵地(POJ-1185)
Problem Description司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示:如果在地图中的灰色所标识的平原上部署一支炮兵部队,则图中...原创 2018-08-21 14:04:37 · 664 阅读 · 0 评论 -
最小总代价(洛谷-U17433)
题目描述n个人在做传递物品的游戏,编号为1-n。游戏规则是这样的:开始时物品可以在任意一人手上,他可把物品传递给其他人中的任意一位;下一个人可以传递给未接过物品的任意一人。即物品只能经过同一个人一次,而且每次传递过程都有一个代价;不同的人传给不同的人的代价值之间没有联系;求当物品经过所有n个人后,整个过程的总代价是多少。输入输出格式输入格式:第一行为n,表示共有n个人...原创 2018-08-21 12:07:00 · 1066 阅读 · 0 评论 -
Mondriaan's Dream(POJ-2411)
Problem DescriptionSquares 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...原创 2018-08-21 11:59:23 · 803 阅读 · 0 评论 -
动态规划 —— 状压 DP
【概述】通常将以一个集合内的元素信息作为状态且状态总数为指数级别的动态规划称为状态压缩动态规划。其是一类以集合信息为状态的特殊的动态规划问题,主要有传统集合动态规划与基于连通性状态压缩的动态规划两种。其原理是通过二进制位运算将状态压缩(用整数表示集合)作为动态规划的状态来解决问题。通常具备以下两个特点:数据规模的某一维或几维特别小 需要具备动态规划问题的两个基本性质:最优性原...原创 2018-08-21 09:53:09 · 857 阅读 · 0 评论 -
Traveling(HDU-3011)
Problem DescriptionAfter 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...原创 2018-08-22 14:09:18 · 306 阅读 · 0 评论 -
Most Powerful(ZOJ-3471)
Problem DescriptionRecently, 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 disappea...原创 2018-08-22 11:33:47 · 230 阅读 · 0 评论 -
Hie with the Pie(POJ-3311)
Problem DescriptionThe 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 del...原创 2018-08-22 10:34:23 · 353 阅读 · 0 评论 -
Riddle(2018 CCPC (秦皇岛站) I 题)
Problem DescriptionInputOutputSample Input331 1 151 1 2 2 3101 2 3 4 5 6 7 8 9 10Sample Output715127Sample Explanation题意:有 t 组数据,对于每组数据,给出 n 个数字,最多有 n 个玩具,其中每个数字有两种含...原创 2019-01-02 13:15:41 · 752 阅读 · 2 评论