赞
踩
题目链接:
题解:
这是个好题啊。贪食蛇。爆搜。
注意一下一些细节和技巧就可以。
可能需要你花很多时间慢慢写....
反正我写了一个晚上....
很考验自己的的代码能力,我写了7K...300+行...
注意:
豆子也要成环...dfs判断一下即可。
然后再BFS,判断是否越界或者撞墙,还要判断豆子能不能吃。还要判断蛇头不能碰到自己。
注意MLE,利用一下位运算就可以了。用bitset大法应该也是可以的。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。