摘要:
原题在这里 题目大意:给定n个数,求出这n个数中第k小的数。 做法: 1.首先直接想到的肯定是直接排序然后\(O(1)\)输出即可。这样的时间复杂度是\(O(nlogn)\),由于题目中n的数据范围过大我们无法接受。 2.再想到,我们在进行快速排序的过程中,随机选取一个数作为基准,每次将比它大的数放 阅读全文
posted @ 2024-12-11 11:23
孤枕
阅读(44)
评论(0)
推荐(0)
摘要:
万能头: #include<bits/stdc++.h> cin加速: ios::sync_with_stdio(0); cin.tie(0); 快读: inline int read() { int x=0,f=1;char ch=getchar(); while (ch<'0'||ch>'9') 阅读全文
posted @ 2024-12-11 10:32
孤枕
阅读(20)
评论(0)
推荐(0)

浙公网安备 33010602011771号