题解列表
C++_DFS(深度优先搜索)
摘要:参考代码:#include<iostream>#include<algorithm>#include<cstdio>using namespace std;int const N =30;int n,……
使用C++STL库中的优先队列
摘要:解题思路:使用C++中的STL库中的优先队列,使用结构体定义一个比较函数进行排序,之后在主函数中使用优先队列输出注意事项:注意结构体里边比较逻辑的写法,这是容易出错的地方参考代码:#include<i……
题目 1770: [编程入门]链表之报数问题
摘要:解题思路:注意事项:参考代码: #include <iostream>using namespace std;struct person{ int num; person* next;};int ma……
手写队列解决滑动窗口
摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;const int N = 1e7 + 10, M = ……
3005:糖果游戏(C++分组法)简单易懂
摘要:解题思路: 通过for循环语句实现糖果的分配,把五个孩子分为第一个孩子,中间的孩子以及最后一个孩子,三组孩子分别处理注意事项: 首尾的处理要单独写出,注意端点处的取值参考代……
2007: 计算输入数据的和与乘积
摘要:解题思路:注意事项:参考代码:#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int m……
2006: 寻找奇整数
摘要:解题思路:注意事项:参考代码:#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int m……
2002: 计算数字个数
摘要:解题思路:注意事项:参考代码:#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int m……
2001: 边长判断---先排序后计算
摘要:解题思路:注意事项:参考代码:#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int m……