有序线表合并(sf13b) 摘要:解题思路:L1.push_back(x);//容器 L1 的尾部添加元素 x L1.push_front(x)//容器 L1 的首部添加元素 x、L1.merge(L2);//合并,原来有序,合并…… 题解列表 2025年05月29日 0 点赞 0 评论 99 浏览 评分:0.0
链表合并map(sf13c) 摘要:解题思路:map<int,int>mp;//一个是键,一个是值//map有自动排序特性注意事项:注意map的输入和输出的方式参考代码:#include<bits/stdc…… 题解列表 2025年05月29日 0 点赞 0 评论 137 浏览 评分:0.0
DFS深度(sf13d) 摘要:解题思路:深度:一个个遍历下去,不撞南墙不回头(南墙:前面没有可以遍历的对象,回头:回到最近的岔路口,走没有走过的其他岔路)&n…… 题解列表 2025年05月30日 0 点赞 0 评论 95 浏览 评分:0.0
拿汽水瓶换汽水 摘要:解题思路: 首先仔细阅读题目可以得知在拥有一定瓶子数的情况下,每当有三个瓶子就可以换一瓶汽水,所以第一个能想到的是用瓶子数取3的整除得到换取的汽水数,那么将其喝掉后会得到新的瓶子,只需与原…… 题解列表 2025年06月01日 0 点赞 0 评论 87 浏览 评分:0.0
dfs深度(sf13e) 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int n,m,cnt=0;int a[102];int visited…… 题解列表 2025年06月01日 0 点赞 0 评论 114 浏览 评分:0.0
连通图是否连通(sf14a) 摘要:解题思路:注意事项:记得压缩路径参考代码:#include<bits/stdc++.h>using namespace std;const int N=1005;int father[N]…… 题解列表 2025年06月01日 0 点赞 0 评论 88 浏览 评分:0.0
连通图(sf14b) 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;const int N=100005;int father[N];//找…… 题解列表 2025年06月01日 0 点赞 0 评论 100 浏览 评分:0.0
连通图(sf14d) 摘要:解题思路:注意事项:真的很无语参考代码:#include<bits/stdc++.h>using namespace std;short father[20005];int n,m,w;i…… 题解列表 2025年06月01日 0 点赞 0 评论 86 浏览 评分:0.0