提交时间:2022-07-29 15:44:59
运行 ID: 54492
#include<bits/stdc++.h> using namespace std; int n,k,b[110],a,d; int main(){ cin>>n>>k; if(n<k) cout<<"NO RESULT"; for(int i=1;i<=n;i++){ cin>>b[i]; } for(int i=1;i<=n;i++){ a=i; while(1){ if(b[i+1]<b[i]) swap(b[i],b[i+1]); else if(b[i+1]==b[i]) d++; else break; } } cout<<b[d+k]; return 0; }