题意:给一个n*m的格子,格子中有一些数,如果是正整数则为到此格子的花费,如果为-1表示此格子不可到,现在给k个宝藏的地点(k#include #include #include #include #include #define Mod 1000000007using namespace std;...
分类:
其他好文 时间:
2014-09-09 15:05:38
阅读次数:
276
We Need Medicine
Time Limit: 10 Seconds Memory Limit: 65536 KB Special Judge
A terrible disease broke out! The disease was caused by a new type of virus, which will lead to lethal lymp...
分类:
其他好文 时间:
2014-09-09 12:55:12
阅读次数:
301
Zhuge Liang's Mines
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1318 Accepted Submission(s): 557
Problem Description
In the ...
分类:
其他好文 时间:
2014-09-06 16:11:53
阅读次数:
278
感觉白书上的做法很神!首先状压表示电脑之间的联通关系,然后预处理出所有关闭电脑的组合达到的状态,然后枚举每个状态并且枚举每个状态的所有子集,之后无脑递推就木有了。关于枚举一个状态所有子集的小技巧:假设当前状态是S0有for s = s0; s != 0; s = (s - 1) & s0#inclu...
分类:
其他好文 时间:
2014-09-06 10:53:03
阅读次数:
161
直接从前往后DP,因为一共只有500个数,所以累加起来的话单个数不会超过4096,并且因为是Flappy 2048的规则,所以只有之后数列末尾一串递减的是有效的,因此可以状压。1700ms = =,据说用滚动数组优化一下会好很多#include #include #include #include ...
分类:
其他好文 时间:
2014-09-01 20:55:43
阅读次数:
221
题目链接题意 :每一颗子弹破坏了三个邻近的阳台。(第N个阳台是与第1个相邻)射击后后的生存的怪物都对主角造成伤害- 如此,直到所有的怪物被消灭,求怎样射击才能受到最少伤害。思路 : 状压,数据不是很大,可以爆一爆,或者DFS下去就行,枚举每一种状态。 1 //1152 2 #include 3 #....
分类:
其他好文 时间:
2014-08-31 21:21:51
阅读次数:
236
C -Hie with the PieTime Limit:2000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusAppoint description:DescriptionThe Pizazz Pizzeria pr...
分类:
其他好文 时间:
2014-08-31 17:12:21
阅读次数:
460
Problem Description
Rompire is a robot kingdom and a lot of robots live there peacefully. But one day, the king of Rompire was captured by human beings. His thinking circuit was changed by human an...
分类:
其他好文 时间:
2014-08-28 11:27:09
阅读次数:
265
转自:http://blog.csdn.net/a497406594/article/details/38442893Kill the MonstersTime Limit: 7 Seconds Memory Limit: 32768 KB In order to celebrate the 8t....
分类:
其他好文 时间:
2014-08-27 20:11:48
阅读次数:
273
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4918
昨天的排位,最初我还以为思维题,然后队友说状压DP,直接放弃,赛后看了队友的代码,在搜下网上的,发现队友的代码居然是最短的,膜拜啊~~~~~~~
思路是队友 A.L.的
dp[s]=min(dp[s],dp[s']+1)
其中s'可以由s通过一次正着剪指甲或者反着...
分类:
其他好文 时间:
2014-08-27 18:52:58
阅读次数:
176