2684: 蓝桥杯2022年第十三届省赛真题-数位排序-sort 摘要: #include #include using namespace std; bool cmp(int x,int y){ int sum1=0…… 题解列表 2024年04月08日 3 点赞 0 评论 145 浏览 评分:10.0
数位排序暴力 摘要:解题思路:暴力注意事项:无参考代码:#pragma GCC optimize(3) #include <bits/stdc++.h> using namespace std; #define e…… 题解列表 2023年11月10日 0 点赞 0 评论 337 浏览 评分:9.9
sort排序自定义 摘要:#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 10; int n, m; struct node { …… 题解列表 2024年03月20日 0 点赞 0 评论 105 浏览 评分:9.9
数位排序—sort快速排序 摘要:解题思路:将数值 i 和其数位和 ans 分别存放在两个数组之中,再利用 sort 快速排序对 a 数组进行排序注意事项:sort函数的cmp比较函数需要自己编写,注意sort排序的起止点的指针与cm…… 题解列表 2023年03月12日 0 点赞 0 评论 280 浏览 评分:9.9
蓝桥杯2022年第十三届省赛真题-数位排序 摘要:解题思路:vector变长数组。注意事项:不要超时。参考代码:#include <iostream>#include <vector>#include <set>#include <string>#i…… 题解列表 2023年04月02日 0 点赞 0 评论 444 浏览 评分:9.9
数位排序 运用sort自定义排序 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;bool cmp(int a,int b){ int a…… 题解列表 2023年11月24日 0 点赞 1 评论 228 浏览 评分:9.9
利用c++结构体重构小于计算来使用sort排序 摘要:解题思路:创建结构体用number存储数值,len存储各各数位相加的结果。根据题意定义小于运算,然后可以直接使用c++内置的sort函数进行排序。注意事项:参考代码:#include<bits/std…… 题解列表 2023年03月17日 0 点赞 0 评论 369 浏览 评分:9.9
蓝桥杯2022第十三届省赛真题——数位排序 摘要:解题思路:用记忆化搜索(或是递推)求出1-n的每个数的数位和,时间复杂度为O(n),然后用sort排序,时间复杂度为O(nlogn),最后输出排序后的第m个位置的数注意事项: 不会超时参考代码:#i…… 题解列表 2022年11月14日 0 点赞 0 评论 299 浏览 评分:2.0
蓝桥杯2022年第十三届省赛真题-数位排序 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int i,n,m,t,s; cin>>n>>m…… 题解列表 2024年03月05日 0 点赞 0 评论 157 浏览 评分:0.0
sort函数妙解数位排序 摘要:解题思路:在sort函数中添加优化的比较函数cmp注意事项:数组要比十万大一点参考代码:#include <iostream> #include<algorithm> using namespac…… 题解列表 2024年03月28日 0 点赞 0 评论 70 浏览 评分:0.0