C++:set容器+vector容器+更改set容器排列规则 摘要:解题思路:注意事项://修改方法2// 比较函数bool compare(int a, int b){ return a > b; // 这里定…… 题解列表 2025年04月29日 1 点赞 0 评论 85 浏览 评分:0.0
1169: 绝对值排序(快排) 摘要:解题思路:快排注意事项:参考代码:#include<iostream> #include<cstring> #include<cmath> using namespace std; const…… 题解列表 2024年09月04日 0 点赞 0 评论 260 浏览 评分:9.9
1169: 绝对值排序 摘要:解题思路:归并排序注意事项:参考代码:#include<iostream> #include<cstring> #include<cmath> using namespace std; con…… 题解列表 2024年09月04日 0 点赞 0 评论 214 浏览 评分:0.0
简简单单输入n(n<=100)个整数,按照绝对值从大到小排序后输出。题目保证对于每一个测试实例,所有的数的绝对值都不相等。 摘要:解题思路:注意事项:函数调用一大堆,哈哈哈就是面向对象参考代码:#include <iostream> #include <vector> #include <algorithm> #inclu…… 题解列表 2024年08月27日 0 点赞 0 评论 207 浏览 评分:0.0
1169: 绝对值排序 摘要:```cpp #include using namespace std; bool cmp(int x,int y){ return abs(x)>abs(y); } int px…… 题解列表 2024年08月01日 0 点赞 0 评论 168 浏览 评分:0.0
1169 绝对值排序(sort排序) 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>#include<cmath>using namespace std;bool compare(…… 题解列表 2024年07月10日 0 点赞 0 评论 120 浏览 评分:0.0
1169: 绝对值排序(改编一下sort函数,超方便) 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;bool cmp(int a,int b);int ma…… 题解列表 2024年03月13日 0 点赞 0 评论 182 浏览 评分:9.9
绝对值排序 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool cmp(int a,int b){ return abs(a)>ab…… 题解列表 2024年03月03日 0 点赞 0 评论 154 浏览 评分:0.0
绝对值排序(STL秒了) 不需要用队列 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h> using namespace std; bool cmp(int &x,int &y){ return ab…… 题解列表 2024年02月29日 0 点赞 0 评论 131 浏览 评分:0.0
使用C++STL库中的优先队列 摘要:解题思路:使用C++中的STL库中的优先队列,使用结构体定义一个比较函数进行排序,之后在主函数中使用优先队列输出注意事项:注意结构体里边比较逻辑的写法,这是容易出错的地方参考代码:#include<i…… 题解列表 2023年10月20日 0 点赞 0 评论 102 浏览 评分:0.0