Cod sursa(job #545940)
Utilizator | Data | 4 martie 2011 09:56:01 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.32 kb |
#include<fstream>
#include<algorithm>
using namespace std;
int n,i,k,V[3000000];
int main()
{
ifstream in("sdo.in");
ofstream out("sdo.out");
in>>n>>k;
for(i=1;i<=n;i++)
in>>V[i];
nth_element(V+1,V+k,V+n+1);
out<<V[k];
in.close();
out.close();
return 0;
}