Cod sursa(job #3327961)

Utilizator andu2006Alexandru Gheorghies andu2006 Data 5 decembrie 2025 18:23:55
Problema Statistici de ordine Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.72 kb
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double ld;
const ll NMAX=3e6+5,MOD=1e9+7,INF=1e18;
/// 000000000000|255|232|28|2|0
/// int x;
/// &x = adresa lui x (x este o variabila)
/// *x = valoarea aflata la adresa x (x este un pointer/adresa)

/// 0000000000 0000 1111 2222 00

/// pointer ptr1 - pointer ptr2 = (ptr1-ptr2) / sizeof(*ptr1)
/// 8 3
/// 1 10 4 13 7 6 11 14
/// pq: {6,4,1}
int v[NMAX];
int main()
{
    //#ifdef LOCAL
        freopen("sdo.in","r",stdin);
        freopen("sdo.out","w",stdout);
    //#endif
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int n,k;
    cin>>n>>k;
    for(int i=0;i<n;i++) cin>>v[i];
    sort(v,v+n);
    cout<<v[k-1];
    return 0;
}