题解列表

筛选

set去重且排序(sf12b)

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ set<int>myset; //s……

vector字符串(sf12a)

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ string s1; while(cin>……

连通图(sf14e)

摘要:解题思路:在处理边的关系时,边的两个端点的根相同,则这条边冗余注意事项:参考代码:#include<bits/stdc++.h>using namespace std;const int ……

连通图(sf14d)

摘要:解题思路:注意事项:真的很无语参考代码:#include<bits/stdc++.h>using namespace std;short father[20005];int n,m,w;i……

连通图(sf14b)

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;const int N=100005;int father[N];//找……

连通图是否连通(sf14a)

摘要:解题思路:注意事项:记得压缩路径参考代码:#include<bits/stdc++.h>using namespace std;const int N=1005;int father[N]……

dfs深度(sf13e)

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int n,m,cnt=0;int a[102];int visited……

拿汽水瓶换汽水

摘要:解题思路: 首先仔细阅读题目可以得知在拥有一定瓶子数的情况下,每当有三个瓶子就可以换一瓶汽水,所以第一个能想到的是用瓶子数取3的整除得到换取的汽水数,那么将其喝掉后会得到新的瓶子,只需与原……