数位排序 运用sort自定义排序 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;bool cmp(int a,int b){ int a…… 题解列表 2023年11月24日 0 点赞 1 评论 298 浏览 评分:10.0
2684: 蓝桥杯2022年第十三届省赛真题-数位排序-sort 摘要: #include #include using namespace std; bool cmp(int x,int y){ int sum1=0…… 题解列表 2024年04月08日 4 点赞 0 评论 346 浏览 评分:10.0
数位排序—sort快速排序 摘要:解题思路:将数值 i 和其数位和 ans 分别存放在两个数组之中,再利用 sort 快速排序对 a 数组进行排序注意事项:sort函数的cmp比较函数需要自己编写,注意sort排序的起止点的指针与cm…… 题解列表 2023年03月12日 0 点赞 0 评论 362 浏览 评分:9.9
利用c++结构体重构小于计算来使用sort排序 摘要:解题思路:创建结构体用number存储数值,len存储各各数位相加的结果。根据题意定义小于运算,然后可以直接使用c++内置的sort函数进行排序。注意事项:参考代码:#include<bits/std…… 题解列表 2023年03月17日 0 点赞 0 评论 451 浏览 评分:9.9
蓝桥杯2022年第十三届省赛真题-数位排序 摘要:解题思路:vector变长数组。注意事项:不要超时。参考代码:#include <iostream>#include <vector>#include <set>#include <string>#i…… 题解列表 2023年04月02日 0 点赞 0 评论 519 浏览 评分:9.9
数位排序暴力 摘要:解题思路:暴力注意事项:无参考代码:#pragma GCC optimize(3) #include <bits/stdc++.h> using namespace std; #define e…… 题解列表 2023年11月10日 0 点赞 0 评论 406 浏览 评分: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 评论 198 浏览 评分:9.9
蓝桥杯2022第十三届省赛真题——数位排序 摘要:解题思路:用记忆化搜索(或是递推)求出1-n的每个数的数位和,时间复杂度为O(n),然后用sort排序,时间复杂度为O(nlogn),最后输出排序后的第m个位置的数注意事项: 不会超时参考代码:#i…… 题解列表 2022年11月14日 0 点赞 0 评论 329 浏览 评分:2.0
哈希-数位排序 摘要:```cpp #include using namespace std; int n,m; vector h[100]; int main() { cin>>n>>m; f…… 题解列表 2022年05月15日 0 点赞 0 评论 416 浏览 评分:0.0
创建vector数组对n进行分配并搜索 摘要:解题思路:空间换时间,使用创建多个vector存储求完数位和的数,从1开始计算,由于同一数位和的数小的一定在前面,所以直接push_back尾部插入. 插入完成后再用循环对vector的…… 题解列表 2023年02月20日 0 点赞 0 评论 132 浏览 评分:0.0