Cod sursa(job #2538658)
| Utilizator | Data | 4 februarie 2020 21:54:47 | |
|---|---|---|---|
| Problema | Statistici de ordine | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.51 kb |
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
typedef unsigned long long ul;
typedef long long ll;
using namespace std;
ll n, k, c;
int main(){
ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
ifstream cin("sdo.in");
ofstream cout("sdo.out");
vector <ll> a;
cin >> n >> k;
for (ll i = 0; i < n; i++)
{
cin >> c;
a.pb(c);
}
nth_element(a.begin(), a.begin() + k - 1, a.end());
cout << a[k - 1];
return 0;
}
