LETTERS(经典DFS) 摘要:解题思路:注意事项:参考代码:#include<iostream> #include<cstdio> using namespace std; int r, s,t1=0,t2;//r,s表示迷…… 题解列表 2024年03月14日 0 点赞 0 评论 228 浏览 评分:10.0
3035题解 dfs深搜 摘要:解题思路:直接搜索注意事项:参考代码:#include<iostream> #include<cstring> #include<cmath> #include<algorithm> #inc…… 题解列表 2023年01月25日 0 点赞 6 评论 407 浏览 评分:9.9
LETTERS(dfs) 摘要:解题思路: 因为涉及到回溯找最长的 所以最好用dfs递归注意事项: 多练就行了 没啥注意的参考代码:/* 3 6 HFDFFB AJHGDH DGAGEH */ #include<i…… 题解列表 2023年08月13日 0 点赞 0 评论 326 浏览 评分:9.9
LETTERS:DFS(搜索与回溯)、C++ 摘要: #### 注意 题目要求不能回到走过的字母,因此注意回溯 判断条件有两个关键:其一是越界,其二是标记数组 ```cpp DFS基本模板如下 void dfs(int k,…… 题解列表 2024年02月29日 0 点赞 0 评论 322 浏览 评分:9.9
LETTEARS(走路径) 摘要:```cpp #include using namespace std; #define endl '\n' #define int long long const int N=2…… 题解列表 2024年04月19日 0 点赞 0 评论 250 浏览 评分:9.9
[LETTERS] BFS 配合 map容器 摘要:## unordered_map 的.count函数-用于查找是否出现过该状态,是返回1; ```cpp #include #define ULL unsigned long long #d…… 题解列表 2024年09月14日 0 点赞 1 评论 170 浏览 评分:9.9
dfs--字符转数存状态//[LETTERS] 摘要:# 利用Ascall码性质 将字符转为数字存在数组跟新状态 ###### 话说unordered_map也有这种性质 但是我用他wa了一个点 首先 看到最多 最长 类似的字样 首先想到的是深搜…… 题解列表 2024年09月15日 0 点赞 1 评论 180 浏览 评分:9.9
LETTERS 搜搜搜搜搜搜 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 定义全局变量r和s,kkk初始化为-1 int r, s, kkk …… 题解列表 2024年11月23日 0 点赞 0 评论 203 浏览 评分:0.0
dfs求解最长“不同字符路径”(map版) 摘要: #include #include using namespace std; const int N = 25; map ma; int n, m,step; int d…… 题解列表 2025年03月06日 0 点赞 0 评论 197 浏览 评分:0.0
dfs菜鸟级包能懂 摘要:解题思路:dfs直接搜,拿一个数组存一下访问过的数组就行啦,变量名不规范见谅注意事项:参考代码:#include<bits/stdc++.h>using namespace std;con…… 题解列表 2025年04月07日 0 点赞 0 评论 93 浏览 评分:0.0