版本比较
因该最短路总结
正文
增加 5 行删除 5 行
72 行未改动73747576777778798081828384848586878875 行未改动16416516616716816816917017117217317417517517617717717817918018112 行未改动72 行未改动 } vis[sx][sy] = 1; q.push({sx , sy , u.s + 1 , 0}); if(sx == n && sy == n){// cout << u.x << " " << u.y << " " << sx << " " << sy << "\n"; // cout << u.x << " " << u.y << " " << sx << " " << sy << "\n"; return u.s + 1; } } } } return -1;} }signed main(){ ios::sync_with_stdio(0); cin.tie(0),cout.tie(0); cin >> n;75 行未改动 } } cout << "Poor ANGEL has to stay in the prison all his life.\n"; return;} }signed main(){ ios::sync_with_stdio(0); cin.tie(0),cout.tie(0); while(cin >> n >> m){ for(int i = 1 ; i <= n ; i ++){ for(int j = 1 ; j <= m ; j ++){ cin >> a[i][j]; cin >> a[i][j]; } } } for(int i = 1 ; i <= n ; i ++){ for(int j = 1 ; j <= m ; j ++){ if(a[i][j] == 'a'){ tx = i,ty = j;12 行未改动