题解列表
字符逆序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……
蓝桥杯2019年第十届真题-完全二叉树的权值 优质题解
摘要:#include <iostream>
#include<math.h>
using namespace std;
int main()
{
int N;
cin>>N;
……
简单粗暴(适合小白)
摘要:解题思路:依题目内容暴力!!!!注意事项:无参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int i,n,j,m,k,c,d[……
1008: [编程入门]成绩评定
摘要:解题思路:switch判断注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int a; cin>>a; ……
蓝桥杯2018年第九届真题-缩位求和
摘要:参考代码:#include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
……
蓝桥杯算法提高VIP-计算质因子 vector,iterator解法
摘要:解题思路:先找出所有的质因子,压紧vector,随后通过迭代器去重;注意事项:去重时,遍历要从迭代器的begin+1开始;参考代码:#include<iostream>
#include<vecto……