http://www.lydsy.com/JudgeOnline/problem.php?id=4160 给一张无向图,求定向后所成DAG的最长路的最小值。 因为点数比较少,考虑状态压缩DP。 根据 Dilworth 定理,有向无环图的最长链长度,等于最少反链划分数量。所以问题等价于,把点集分...
分类:
数据库 时间:
2015-09-23 10:13:44
阅读次数:
220
Problem DescriptionRompire is a robot kingdom and a lot of robots live there peacefully. But one day, the king of Rompire was captured by human beings...
分类:
其他好文 时间:
2015-09-22 18:41:30
阅读次数:
149
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=5418Victor and WorldTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 262144/131072 K (Java/Others)To...
分类:
其他好文 时间:
2015-09-21 23:43:13
阅读次数:
222
题目大意:一张无向连通图,有一个机器人,若干个石头,每次移动只能移向相连的节点,并且一个节点上只能有一样且一个东西(机器人或石头),找出一种使机器人从指定位置到另一个指定位置的最小步数方案,输出移动步骤。题目分析:以机器人的所在位置和石头所在位置集合标记状态,状态数最多有15*2^15个。广搜之。代...
分类:
其他好文 时间:
2015-09-21 17:14:56
阅读次数:
357
无非就是横着放与竖着放,状态中用1表示覆盖,0表示未覆盖。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 1...
分类:
其他好文 时间:
2015-09-18 23:24:30
阅读次数:
148
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5418题目大意:有n个结点m条边(有边权)组成的一张连通图(n #include #include #include using namespace std;int dp[1 > q; q....
分类:
其他好文 时间:
2015-09-18 21:58:18
阅读次数:
253
北大教你怎么打保龄球题目很简单的,我就不翻译了,简单来说就是储存每一行的总数,类似于状态压缩 1 #include 2 #include 3 #define MAX(a,b) a>b?a:b 4 5 int Cow_Map[351][...
分类:
其他好文 时间:
2015-09-16 00:51:32
阅读次数:
136
DescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and ...
分类:
其他好文 时间:
2015-09-15 21:36:04
阅读次数:
205
Recently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of these atoms c...
分类:
其他好文 时间:
2015-09-15 14:21:07
阅读次数:
170
DescriptionThe Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can affor...
分类:
其他好文 时间:
2015-09-14 22:42:09
阅读次数:
210