题目大意是给出一幅n*n的地图,一开始处于(1,1)的位置,每次最多可以向同一个方向移动k步,每次停留的地点要比上一次停留的地点的数字大,问停留地点的数字和最大为多少。
这题给了10s的时限,所以加上一些剪枝的暴力搜索应该是可以过的,不过这种最优化问题通常会有DP解法,这题也是非常典型的DP模型。具体做法是利用BFS扩展出每次可能的扩展节点,然后以移动步数作阶段划分状态,利用记忆化搜索来减少冗余查询即可。不过要注意不要像我一样习惯性地把用来记录可扩展节点的队列开在全局数组里……
3001670 2008-07-24 11:54:21 Accepted 1107 FPC 00:00.10 496K IwfWcf
roshe run, http://www.rosherunshoessale.com/
回复删除tory burch outlet, http://www.toryburchoutletonline.in.net/
ralph lauren uk, http://www.ralphlauren-outletonline.co.uk/
michael kors outlet, http://www.michaelkorsoutlet.org.uk/
ralph lauren outlet, http://www.ralphlaurenoutlet.in.net/
asics, http://www.asicsisrael.com/
nike free, http://www.nikefreerunning.org/
coach handbags, http://www.coachhandbagsoutletonline.us.com/
christian louboutin uk, http://www.christianlouboutinoutlet.org.uk/
replica watches, http://www.replicawatchesforsale.us.com/
hogan, http://www.scarpehogan-outlet.it/
stuart weitzman boots, http://www.stuartweitzmanoutlet.us/
basketball shoes, http://www.basketballshoes.us.com/
ray ban sunglasses, http://www.raybansunglass.us.com/
nike huarache, http://www.nikeairhuarache.org.uk/
prada outlet, http://www.pradaoutlet.us/
michael kors handbags, http://www.michaelkorshandbag.co.uk/
air jordan 13, http://www.airjordan13s.com/
air max 90, http://www.airmax90.us.com/
mulberry outlet, http://www.mulberryoutlet.com.co/
hollister, http://www.hollistercanada.com/
toms shoes, http://www.toms.us.com/
louis vuitton outlet, http://www.louisvuittonoutletstore.name/
true religion jeans, http://www.truereligionjean.in.net/
ugg boots, http://www.uggboot.com.co/
michael kors outlet, http://michaelkors.outletonlinestores.us.com/
nike air max uk, http://www.nikeairmaxshoes.org.uk/
air jordan 11, http://www.airjordan11.net/
1003maoqiuyun
ray bans uk
回复删除cheap oakley sunglasses
true religion
uggs outlet
replica rolex watches
hollister outlet
north face
heat jerseys
coach factory outlet
uggs outlet
201612.26chenjinyan
golden goose outlet
回复删除supreme new york
off white shoes
kd shoes
adidas nmd
supreme clothing
michael kors handbags
supreme clothing
nike air max 2017
supreme clothing