Pagini recente » Cod sursa (job #286578) | Cod sursa (job #2834812) | Cod sursa (job #2343521) | Cod sursa (job #1015090) | Cod sursa (job #2471751)
/*
`-/oo+/- ``
.oyhhhhhhyo.`od
+hhhhyyoooos. h/
+hhyso++oosy- /s
.yoooossyyo:``-y`
..----.` ``.-/+:.`
`````..-::/.
`..```.-::///`
`-.....--::::/:
`.......--::////:
`...`....---:::://:
`......``..--:::::///:`
`---.......--:::::////+/`
----------::::::/::///++:
----:---:::::///////////:`
.----::::::////////////:-`
`----::::::::::/::::::::-
`.-----:::::::::::::::-
...----:::::::::/:-`
`.---::/+osss+:`
``.:://///-.
*/
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <cmath>
#define INF 0x3f3f3f3f
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) < (b)) ? (b) : (a))
using namespace std;
int v[3000005];
int main()
{
freopen("sdo.in","r",stdin);
freopen("sdo.out","w",stdout);
int n, k;
scanf("%d%d", &n, &k);
for(int i = 1; i <= n; i++) scanf("%d", &v[i]);
nth_element(v + 1, v + k, v + n + 1);
printf("%d\n", v[k]);
return 0;
}