状态压缩DP
bao___zi
ACM 弱鸡一枚
What this era lacks is not the person who is perfect but the person who is with virtue, justice, courage and compassion.
展开
-
HDU 1074 状态压缩DP入门(1)
Problem Description 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 t...原创 2018-03-12 21:32:19 · 189 阅读 · 1 评论 -
HDU 1565 方格取数(1) (状态压缩DP入门题 2)(待更新)
Problem Description 给你一个n*n的格子的棋盘,每个格子里面有一个非负数。从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数的和最大。 Input 包括多个测试实例,每个测试实例包括一个整数n 和n*n个非负数(n<=20) Output 对于每个测试实例,输出可能取得的最大的和 Sample Input375 15...原创 2018-03-13 11:04:56 · 272 阅读 · 1 评论 -
HDU 2167 Pebbles 状态压缩DP入门题(3)
Problem Description 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 betwe...原创 2018-03-13 23:56:28 · 189 阅读 · 0 评论 -
hihoCoder 状态压缩二 状态压缩dp 入门题 4
描述 历经千辛万苦,小Hi和小Ho终于到达了举办美食节的城市!虽然人山人海,但小Hi和小Ho仍然抑制不住兴奋之情,他们放下行李便投入到了美食节的活动当中。美食节的各个摊位上各自有着非常多的有意思的小游戏,其中一个便是这样子的: 小Hi和小Ho领到了一个大小为N*M的长方形盘子,他们可以用这个盒子来装一些大小为2*1的蛋糕。但是根据要求,他们一定要将这个盘子装的满满的,一点缝隙也不能留下来,才能...原创 2018-07-26 08:33:56 · 304 阅读 · 0 评论 -
hihocoder 1048 Hamiltonian Cycle 状态压缩dp入门题5
描述 Given a directed graph containing n vertice (numbered from 1 to n) and m edges. Can you tell us how many different Hamiltonian Cycles are there in this graph? A Hamiltonian Cycle is a cycle that ...原创 2018-07-30 08:46:47 · 173 阅读 · 0 评论