作业之考试3
原本想用桶排去重,结果这道题没有重复的数,那就直接sort排序了。
#include<bits/stdc++.h>
using namespace std;
int ha[3000001];
int l,m,n;
int main(){
scanf("%d%d",&n,&m);
for(int z=1;z<=n;++z){
int a;
scanf("%d",&ha[z]);
}
sort(ha+1,ha+n+1);
printf("%d",ha[n-m+1]);
}

相关文章:

  • 2022-01-03
  • 2021-12-27
  • 2021-04-15
  • 2021-11-28
  • 2021-12-05
  • 2022-02-08
  • 2022-02-08
猜你喜欢
  • 2021-07-20
  • 2021-10-27
  • 2022-01-19
  • 2021-06-21
  • 2021-04-07
相关资源
相似解决方案