小胡放轻松
小胡放轻松
全部文章
分类
归档
标签
去牛客网
登录
/
注册
小胡放轻松的博客
全部文章
(共70篇)
题解 | 剪纸游戏
#include <iostream> #include <queue> #define maxsize 1000 using namespace std; //判断传入的连通块是否是矩形,传入外接最小矩形四个顶点,检测矩形中是否有值为1(表示*)的点即可 int chec...
2025-12-17
0
36
题解 | 剪纸游戏
#include <iostream> #include <vector> #include <set> #include <queue> using namespace std; //判断传入的连通块是否是矩形 int check(set<p...
2025-12-16
0
33
题解 | 火车进站
#include <iostream> #include <stack> #include <queue> #include <vector> #include <algorithm> using namespace std; void ...
2025-12-13
0
30
题解 | 迷宫寻路
#include <iostream> #include <vector> using namespace std; //深度优先搜索算法对(1,1)的邻近格子进行染色(矩阵值置为2) void dfs(int i, int j, vector<vector<i...
2025-12-11
0
42
题解 | 数水坑
/*基本思路是通过外层两个遍历遍历矩阵,并设置res初值为0,对每一个外层遍历水坑,这里体现为值为0,将其置为2并使res++,同时调用DFS函数将其周围8联通的格子置为2并对8联通的格子递归执行dfs,当外层遍历结束时res值即为答案 */ #include <iostream> #i...
2025-12-11
0
43
题解 | 【模板】图的结构Ⅲ ‖ 二分图判定:染色法
#include <iostream> #include <vector> #include <unordered_map> #include <unordered_set> #include <string> using namespac...
2025-12-08
0
20
题解 | 图的分类
//所有节点度数均为2是环形 //所有节点中有两个结点度为1,其它结点度为2是链型 //在上述两种情况之外,所有节点中只有度为1和2的结点以及一个度大于等于3的结点,是星型 #include <iostream> #include <vector> using namespa...
2025-12-08
1
28
题解 | 表达式求值
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 返回表达式的值 * @param s string字符串 待计算的表达式 * @return in...
2025-12-04
0
18
题解 | 游游的最长稳定子数组
#include <iostream> #include <vector> using namespace std; int main() { //输入数据 int n; cin >> n; vector<int> a...
2025-12-03
0
21
题解 | 游游的最长稳定子数组
#include <iostream> #include <vector> using namespace std; int main() { //输入数据 int n; cin >> n; vector<int> a...
2025-12-03
0
23
首页
上一页
1
2
3
4
5
6
7
下一页
末页