Pagini recente » Cod sursa (job #1032891) | Cod sursa (job #2060090) | Cod sursa (job #294887) | Cod sursa (job #1892371) | Cod sursa (job #1650262)
# include <fstream>
# include <algorithm>
# include <vector>
# define foreach(A) for(int i=1; i<=(A); ++i)
using namespace std;
ifstream fin("sdo.in");
ofstream fout("sdo.out");
const int MAXN = 3000005;
vector<int> V;
int N, K;
int main() {
int x;
fin >> N >> K;
foreach(N) {
fin >> x;
V.push_back(x);
}
sort(V.begin(), V.end());
fout << V[K-1];
return 0;
}