Cod sursa(job #1142843)
Utilizator | Data | 14 martie 2014 12:05:16 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.31 kb |
#include<cstdio>
#include<algorithm>
using namespace std;
int n,k,V[3000010];
int main()
{
freopen("sdo.in","r",stdin);
freopen("sdo.out","w",stdout);
scanf("%d%d",&n,&k);
for(int i=1;i<=n;i++)scanf("%d",&V[i]);
nth_element(V+1,V+k,V+n+1);
printf("%d\n",V[k]);
return 0;
}