Cod sursa(job #1148635)
Utilizator | Data | 20 martie 2014 22:40:06 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.28 kb |
#include <fstream>
#include <algorithm>
using namespace std;
ifstream f("sdo.in");
ofstream g("sdo.out");
int n,k,V[3000009];
int main()
{
f >> n >> k;
for(int i=1; i<=n; i++) f >> V[i];
nth_element(V+1, V+k, V+1+n);
g << V[k] << '\n';
g.close();
return 0;
}