Cod sursa(job #933247)

Utilizator paulhelmerPaul Helmer paulhelmer Data 29 martie 2013 18:59:10
Problema Statistici de ordine Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.28 kb
#include <fstream>
#include <algorithm>
using namespace std;
int a[3000001], x, y, i;
int main()
{
    ifstream f("dso.in");
    ofstream g("dso.out");
    f >> x >> y;
    for(i=1; i<=x; i++) f >> a[i];
    nth_element(a+1, a+y, a+x+1);
    g << a[y];
    return 0;
}