Cod sursa(job #3367217)
| Utilizator | Data | 6 octombrie 2026 17:07:50 | |
|---|---|---|---|
| Problema | Statistici de ordine | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.37 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("sdo.in");
ofstream fout ("sdo.out");
int main()
{
ios_base::sync_with_stdio(false);
fin.tie(NULL);
int n,k;
fin>>n>>k;
vector<int>v(n);
for(int i=0;i<n;++i){
fin>>v[i];
}
--k;
nth_element(v.begin(),v.begin()+k,v.end());
fout<<v[k];
return 0;
}
