2018-09-24 14:19:58 问题描述: 问题求解: 初看到这个问题,直觉上认为可以通过BFS遍历解空间进行求解,因为本质上来说,这个问题和棋盘上移动马的问题是一类问题,都是可以转化成图的问题,但是MLE了,问题出在在本问题中是不能使用used来保存已经扩展过的节点的,因为相同的节点在不同的阶段的移动步数是不一样的,因此都需要进行入队列的操作. 当然,看到数据规模就应该有意识,这个问题是不能使用暴力搜索来求解的. 事实上,这个问题是一个数学问题,求解方案是: 1)首先负数和其相反数的步…