文章分类 - BFS
摘要:Open the LockTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3210 Accepted Submission(s): 1412Problem DescriptionNow an emergent task for you is to open a password lock. The password is consisted of four digits. Each digit is numbered from 1...
阅读全文
摘要://搜索练习题,深搜广搜也行//437MS 240K 1511 B G++#include#include#include#includechar map[10][10];int mov[4][2]={0,1,1,0,0,-1,-1,0};int n,m,t;int flag;int xb,yb,xe,ye;void dfs(int x,int y,int k){ if(flag) return; if(x==xe && y==ye && k==t){ flag=1;return; } int temp=(t-k)-abs(x-xe)-a...
阅读全文