wgl2009 @ 2021-04-05 10:39:18
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int a[5000005],k;
int main()
{
int n;
cin>>n>>k;
for(int i=0;i<n;i++)
{
cin>>a[i];
}
sort(a,a+n);
cout<<a[k]<<endl;
return 0;
}
提交记录
by CGDGAD @ 2021-04-05 10:44:13
做法错,没这么简单,看题解吧
by WJX3078 @ 2021-04-05 10:46:45
sort的复杂度是
by qqqqq111 @ 2021-04-17 11:28:25
o2,我就用o2过得
by type19 @ 2021-05-23 22:33:31
@wgl2009 同志 , 人家叫你分治 , 你简简单单用sort 或 nth_element , 试试快排+快读