Gap Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 690 Accepted Submission(s): 380 Problem Description Let's play a card game called Gap. You have 28 cards labeled with two-digit numbers…
思路:接BFS判断能否在限制时间内到达公主的位置,注意如果骑士进入传送机就会被立即传送到另一层,不会能再向四周移动了,例如第一层的位置(x, y, 1)是传送机,第二层(x, y, 2)也是传送机,这种情况骑士会一直被传上传下. AC代码: 0ms #include<cstdio> #include<cmath> #include<cstring> #include<queue> using namespace std; const int maxn = 1…