Cod sursa(job #640566)
| Utilizator | Data | 25 noiembrie 2011 22:54:30 | |
|---|---|---|---|
| Problema | Statistici de ordine | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.25 kb |
#include <fstream>
#include <algorithm>
using namespace std;
ifstream fin("sdo.in");
ofstream fout("sdo.out");
int n , k , v[3000005];
int main()
{
fin>>n>>k;
for(int i=1;i<=n;++i)
fin>>v[i];
nth_element(v+1,v+k,v+n+1);
fout<<v[k];
return 0;
}
