Cod sursa(job #1499838)
Utilizator | Data | 11 octombrie 2015 11:05:36 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.23 kb |
#include <fstream>
#include <algorithm>
using namespace std;
int v[3000002],n,k;
ifstream f("sdo.in");
ofstream g("sdo.out");
int main()
{f>>n>>k;
for(int i=1;i<=n;i++)
f>>v[i];
nth_element(v+1,v+k,v+n+1);
g<<v[k];}