Cod sursa(job #2272985)
Utilizator | Data | 30 octombrie 2018 20:34:04 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 20 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.51 kb |
#include <iostream>
#include <fstream>
#include <set>
using namespace std;
ifstream f("sdo.in") ;
ofstream g("sdo.out") ;
long n , i , nr , x ;
int main()
{
set < long long > a ;
set < long long > :: iterator it ;
f >> n >> nr ;
for( i = 1 ; i <= n ; i ++ )
{
f >> x ;
a.insert( x ) ;
}
for( it = a.begin() ; it != a.end() ; it ++ ) {
if( nr == 1 )
{
g << *it ;
break ;
}
nr -- ;
}
}