Cod sursa(job #1650262)
| Utilizator | Data | 11 martie 2016 17:28:25 | |
|---|---|---|---|
| Problema | Statistici de ordine | Scor | 60 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.43 kb |
# 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;
}
