首先```cpp
for(int i=1;i<=r;r++)
for(int j=1;j<=r;j++)
cin>>a[i][j];
for(int i=1;i<=r;r++)
for(int j=1;j<=r;j++)
maxn=max(maxn,dfs(i,j));
for里面应该改成i++。
然后,
```
if(xx>=1&&xx<=c&&yy>=1&&yy<=c&&a[x][y]>a[xx][yy])
```
这里的xx<=c应该改成xx<= r。
[ac代码](https://www.luogu.com.cn/paste/5fpxcajd)
by joejoejoejoe @ 2022-09-02 18:29:20
@[joejoejoe](/user/522673) 感激不尽,谢谢大佬qwq
by FPXS11GO @ 2022-09-02 20:25:10