Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include<stdio.h>#include<string.h>#include<math.h>#include<string>#define INF 0x3fffffff#include<iostream>#include<algorithm>using namespace std;int main(){char a[110][110];int b[110][110][2];//b[i][j][0]表示向右b[i][j][1]表示向下memset(b,0,sizeof(b));int n,m;scanf("%d%d\n",&n,&m);for(int i=1;i<=n;i++){a[i][0]='b';b[i][0][0]=11000;b[i][0][1]=11000;//初始化迷宫的边界for(int j=1;j<=m;j++)cin>>a[i][j];a[i][m+1]='b';}for(int i=0;i<=m;i++)a[0][i]='b',a[n+1][i]='b',b[0][i][1]=11000,b[0][i][0]=11000;//初始化迷宫边界for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){if(i==1&&j==1)b[i][j][0]=0,b[i][j][1]=11000;