玩家无法移动到的地方炸弹产生的火肯定也烧不到,而玩家可以移动到的地方可以通过在起始点处放炸弹用火烧到,因此以初始点进行一次bfs判断四联通区域内有多少个草即可。 #include<bits/stdc++.h> using namespace std; #define LL long long const LL dx[4]={-1,0,0,1},dy[4]={0,-1,1,0}; const LL maxn=1100,M=998244353,inf=1LL<<62; LL n,m,sx,sy,ans=0;char a[maxn][maxn]={}; bool v[maxn...