Cod sursa(job #1011403)
Utilizator | Data | 16 octombrie 2013 20:15:37 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.36 kb |
#include <fstream>
#include <algorithm>
#define Nmax 3000099
using namespace std;
ifstream f("sdo.in");
ofstream g("sdo.out");
int N,K,v[Nmax];
inline void ReadInput()
{
f>>N>>K;
for(int i=1;i<=N;++i)f>>v[i];
}
int main()
{
ReadInput();
nth_element(v+1, v+K, v+N+1);
g<<v[K]<<'\n';
f.close();g.close();
return 0;
}