http://acm.hdu.edu.cn/showproblem.php?pid=4771给一个地图,@是起点,给一些物品坐标,问取完所有物品的最小步数,不能取完输出-1物品数最多只有四个,状态压缩一下bfs即可#include #include #include #include #inclu....
分类:
其他好文 时间:
2015-06-19 01:13:17
阅读次数:
162
题意:你正在玩你最喜欢的电子游戏,并且刚刚进入一个奖励关。在这个奖励关里,系统将依次随 机抛出k次宝物,每次你都可以选择吃或者不吃(必须在抛出下一个宝物之前做出选择,且现在决定不吃的宝物以后也不能再吃)。 宝物一共有n种,系统每次抛出这n种宝物的概率都相同且相互独立。也就是说,即使前k-1次系统都抛...
分类:
其他好文 时间:
2015-06-16 18:44:45
阅读次数:
83
题目大意:给出一个式子,和16个数字,问符合以下两个式子的情况有多少种
x1* 4 + x2* 3 + x3* 2 + x4 = x5 + x6* 2 + x7* 3 + x8* 4
y1* 4 + y2* 3 + y3* 2 + y4 = y5 + y6* 2 + y7* 3 + y8* 4解题思路:枚举4个数字的全排列,然后找一下是否有其他4个数字的全排列的其中一种状况和当前这个情况相同,如...
分类:
其他好文 时间:
2015-06-16 09:23:05
阅读次数:
198
http://acm.hdu.edu.cn/showproblem.php?pid=3006注意到集合内数字最大只有14,状态压缩一下,然后枚举出所有状态#include #include #include using namespace std;int dp[1<<15];int main() {...
分类:
其他好文 时间:
2015-06-15 23:52:58
阅读次数:
128
Escape
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 6239 Accepted Submission(s): 1474
Problem Description
2012 If this is the end...
分类:
其他好文 时间:
2015-06-14 21:30:06
阅读次数:
177
B. Preparing OlympiadYou havenproblems. You have estimated the difficulty of thei-th one as integerci. Now you want to...
分类:
其他好文 时间:
2015-06-14 19:56:44
阅读次数:
109
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4842过河Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Problem Descriptio...
分类:
其他好文 时间:
2015-06-12 20:48:36
阅读次数:
351
问题: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...
分类:
其他好文 时间:
2015-06-11 18:50:10
阅读次数:
128
分析:dp[i][j][k]表示第i行状态为j,i-1行状态为k时的客房士兵的最大值。
曼哈顿距离是指:|x1-x2|+|y1-y2|。
当前行不仅与前一行有关,还和前两行有关,所以开数组的时候还要记录前两行的状态,所以开设三维数组。
每行可压缩为二进制集合,状态dp[i][j][k]为第i行为集合j,第i-1行为集合k,则状态方程dp[i][j][k] = max{dp[i-1][...
分类:
其他好文 时间:
2015-06-08 01:05:56
阅读次数:
161
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4336题目大意:有n种卡片,需要吃零食收集,打开零食,出现第i种卡片的概率是p[i],也有可能不出现卡片。问你收集齐n种卡片,吃的期望零食数是多少?状态压缩:f[mask],代表收集齐了mask,还需要吃...
分类:
其他好文 时间:
2015-06-07 14:32:47
阅读次数:
229