Cod sursa(job #3357940)
| Utilizator | Data | 13 iunie 2026 22:02:47 | |
|---|---|---|---|
| Problema | Statistici de ordine | Scor | 50 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.37 kb |
#include <bits/stdc++.h>
using namespace std;
signed main() {
#ifndef LOCAL
freopen("sdo.in", "r", stdin);
freopen("sdo.out", "w", stdout);
cin.tie(nullptr)->sync_with_stdio(false);
#endif
int n, k; cin >> n >> k;
vector<int> v(n);
for (auto& i : v) cin >> i;
nth_element(v.begin(), v.begin() + k, v.end());
cout << v[k-1] << '\n';
return 0;
}