提交时间:2022-07-30 16:37:02

运行 ID: 55611

#include<bits/stdc++.h> using namespace std; const int MAX = 10001; int a[MAX] = {0}; int main(){ int n, x, k; cin >> n >> k; for(int i = 1; i <= n; i++){ cin >> x; a[x]++; } for(int i = 0;i <= 10000; i++){ if(a[i] != 0) { k--; if(k == 0){ cout << i; return 0; } } } cout << "NO RESULT"; return 0; }