Cod sursa(job #3038518)
Utilizator | Data | 27 martie 2023 14:40:22 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 50 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.3 kb |
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
ifstream cin("sdo.in");
ofstream cout("sdo.out");
int n,k;
int a[3000000];
int main()
{
cin>>n>>k;
for(int i=0;i<n;i++)
cin>>a[i];
nth_element(a,a+k,a+n);
cout<<a[k-1];
return 0;
}