首页 > 腐烂的苹果
头像 张运甫2
发表于 2025-03-15 13:45:09
#include <vector> class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param grid int整型vector< 展开全文
头像 万千少男的梦
发表于 2024-07-24 09:32:26
class Solution { int dx[4] = {1, -1, 0, 0}; int dy[4] = {0, 0, 1, -1}; int row, col; public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回 展开全文
头像 努涅斯不斜视
发表于 2025-01-21 22:41:43
import java.util.*; //多源bfs public class Solution { //用于访问四周节点 int[] dx = {0,0,1,-1}; int[] dy = {1,-1,0,0}; public int rotApple (Array 展开全文
头像 doreminomi
发表于 2023-11-23 17:51:58
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param grid int整型vector<vector<>> 展开全文
头像 可知春风过
发表于 2024-04-18 23:54:55
class Solution { int dx[4] = { 0,0,1,-1 }; int dy[4] = { 1,-1,0,0 }; bool visit[1010][1010] = { false }; public: // 多源 bfs + 最短路 展开全文
头像 上岸了的打工人很想提桶
发表于 2025-02-22 23:49:41
使用一个队列记录腐烂的苹果的位置....有点类似于二叉树的层序遍历.... import java.util.*; public class Solution { public int rotApple(ArrayList<ArrayList<Integer>> g 展开全文
头像 SilverBulletRye
发表于 2024-05-26 16:08:08
class Solution {//多源bfs public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param grid int整型vector<vector<>&g 展开全文
头像 17c89
发表于 2024-04-24 20:46:36
import java.util.*; /** * NC398 腐烂的苹果 * @author d3y1 */ public class Solution { private int ROW; private int COL; private int[] dx = n 展开全文
头像 奶ve
发表于 2024-05-12 09:13:35
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param grid int整型vector<vector<>> 展开全文
头像 smonkey1257
发表于 2024-04-22 14:36:59
class Solution { private: int row, col; // 记录矩阵的行、列 int dx[4] = { 0, 0, -1, 1 }; // 按照上、下、左、右的顺序BFS int dy[4] = { 1, 展开全文

等你来战

查看全部