Cod sursa(job #3367011)
| Utilizator | Data | 5 octombrie 2026 17:47:17 | |
|---|---|---|---|
| Problema | Statistici de ordine | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.38 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("sdo.in");
ofstream fout("sdo.out");
vector<int> v;
int main()
{
int x, n, k, i, ans;
fin >> n >> k;
for(i = 1; i <= n; i ++)
{
fin >> x;
v.push_back(x);
}
auto poz = v.begin() + k - 1;
nth_element(v.begin(), poz, v.end());
fout << *poz;
return 0;
}
