Cod sursa(job #2334221)
| Utilizator | Data | 2 februarie 2019 12:59:06 | |
|---|---|---|---|
| Problema | Statistici de ordine | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.34 kb |
#include <bits/stdc++.h>
#define NMAX 4000005
std::ifstream in("sdo.in");
std::ofstream out("sdo.out");
int n, k;
unsigned int numere[NMAX];
int main() {
in >> n >> k;
for (int i = 1 ; i <= n ; ++ i) in >> numere[i];
std::nth_element(numere + 1, numere + k, numere + n + 1);
out << numere[k] << '\n';
return 0; }
