题解列表

筛选

优质题解

暴力破解C++语言

摘要:解题思路:在做这道题的时候我也是思考了很久,一直没有头绪,在查看了很多人的解法后,我觉得暴力求解最适合我,这里也将自己的理解分享给大家,我认为暴力求解是不走任何捷径的,从一开始依次去验证到末尾,直到得……

题解2213 (送分题)

摘要:解题思路: 直接输出yes注意事项:无参考代码:#include <iostream>using namespace std;int main(){    cout<<"yes";    return……

字符串对比

摘要:#include <iostream>#include<cstring>#include<cmath>using namespace std;int main(){    char str1[10],……

字符逆序cin.get(str,100);

摘要:#include#includeusing namespace std;int main(){    char str[100];    cin.get(str,100);//gets(str);  ……
优质题解

✔✔✔ 树的直径问题+DFS求解 [c++]

摘要:典型的**树的直径**问题:图中所有最短路径的最大值即为「直径」,可以用两次 DFS 或者树形 DP 的方法在 O(n) 时间求出树的直径。 题解以两遍DFS为例 **定理:**在一个连通无向无环……

字符串的输入输出处理

摘要:#include #include#includeusing namespace std; int main() {     int n;char str[1000];    cin>>n……

只做最好的题解

摘要:#include<iostream> //#include<bits/stdc++.h> #include<cmath> #include<cstring> #include<algorith……

简单粗暴(适合小白)

摘要:解题思路:依题目内容暴力!!!!注意事项:无参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int i,n,j,m,k,c,d[……