Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
55109 | 202103Clyde | 第k小整数 | C++ | Accepted | 100 | 1 MS | 276 KB | 272 | 2022-07-29 20:16:32 |
#include <bits/stdc++.h> using namespace std; int a[10005]; int main(){ int n,k; cin>>n>>k; for(int i=0;i<n;i++){ cin>>a[i]; } sort(a,a+n); int count=unique(a,a+n)-a; if(k<=count){ cout<<a[k-1]; } else{ cout<<"NO RESULT"; } return 0; }