摘要: 没啥意义的模拟题。。。 1 #include<bits/stdc++.h> 2 3 using namespace std; 4 const int MAXN=1000; 5 int n,m; 6 //int a[MAXN]; 7 8 struct Peo 9 { 10 int num,cnt; 1 阅读全文
posted @ 2021-05-15 13:00 Adaxy 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 欸嘿,典型的求解第k小的数的问题 算法中使用了快速排序 关键之处在于原本快排需要两边都进行排序,但现在我们只关心第k小的数,所以,如果在ll比k大那么就排左半边,比k小就比右半边,从而实现时间复杂度的下降 1 #include<bits/stdc++.h> 2 3 using namespace s 阅读全文
posted @ 2021-05-15 12:02 Adaxy 阅读(128) 评论(0) 推荐(0) 编辑