bfs #include <bits/stdc++.h> const int maxn = 100; using namespace std; int n, m, t; bool hasDanger[maxn + 10][maxn + 10]; int danger[maxn + 10][maxn + 10][2]; struct tNode { int r, c; int time; tNode(int rr, int cc, int ttime):r(rr), c(cc), time(tt…