文章
34
粉丝
89
获赞
3
访问
20.6k
#include <iostream> #include<cstdio> #include<string> #include<queue> #include<cstring> using namespace std; struct Info{ int x,y; int time; }; int dir[4][2] = {0, 1, 1, 0, 0, -1, -1, 0}; queue<Info> posQue; int main() { int n, m, t; while (scanf("%d%d%d", &n, &m, &t) != EOF) { char map[n][m]; bool isVisit[n][m]; memset(isVisit, false, sizeof(isVisit)); Info first; int ix,iy; for (int i = 0; i < n; i++) { scanf("%s", map[i]); for (int j = 0; j < m; j++) { if (map[i][j] == '*') { ix = i; iy = j; } } } first.x = ix; first.y = iy; int ans = -1; first.time = 0; posQue.push(first); while (!posQue.empty()) { Info cur = posQue.fr...
登录后发布评论
暂无评论,来抢沙发