60求调
查看原帖
60求调
1329906
wenxuliang楼主2024/9/7 21:39
#include <bits/stdc++.h>
using namespace std;
long long i,j,n,m;
char a[1005][1005];
bool f;
bool fuck(int q,int p){
	if(q==n&&p==m)return true;
	if(a[q][p]!='.')return false;
	else{
		a[q][p]=='#';
		return a[q][p+1]||a[q+1][p]||a[max(1,q-1)][p]||a[q][max(1,p)];
	}
}
int main()
{
	cin>>n>>m;
	for(i=1;i<=n;i++){
		for(j=1;j<=m;j++){
			cin>>a[i][j];
		}
	}
	if(fuck(1,1))cout<<"Yes";
	else cout<<"No";
    return 0;
}
2024/9/7 21:39
加载中...