RE求大佬调

P1451 求细胞数量

有没有亿种可能,nx与ny越界了 吐槽一下:主函数的循环最好别压行,代码复杂或要调试加东西时你会晕的(我原来被坑死啦)
by xujinxuan01 @ 2024-03-28 20:37:08


@[xujinxuan01](/user/732034) 判断时出现了a[-1][-1]的情况 应改成: ```cpp if (nx >= 0 && ny >= 0 && nx < n && ny < n &&a[nx][ny] != 48){ dfs(nx, ny); } ``````
by xujinxuan01 @ 2024-03-28 20:39:58


样例还是没过
by _l_j_y_ @ 2024-03-28 20:42:14


@[xujinxuan01](/user/732034) 应改成: ``` cpp if (nx >= 0 && ny >= 0 && nx < n && ny < m &&a[nx][ny] != 48){ dfs(nx, ny); } ```
by _l_j_y_ @ 2024-03-28 20:44:01


@[chenqile](/user/953664)
by _l_j_y_ @ 2024-03-28 20:44:28


@[_l_j_y_](/user/745970) 谢谢纠错(手残了)
by xujinxuan01 @ 2024-03-28 20:51:24


|