Cod sursa(job #3252618)
Utilizator | Data | 30 octombrie 2024 12:14:46 | |
---|---|---|---|
Problema | Statistici de ordine | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.39 kb |
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define MAX 3000000
using namespace std;
ifstream fin("sdo.in");
ofstream fout("sdo.out");
int32_t n, k, i, a[MAX];
int main()
{
ios_base::sync_with_stdio(false);
fin.tie(nullptr);
fout.tie(nullptr);
fin >> n >> k;
for(i=0; i < n; i++) fin >> a[i];
nth_element(a, a+--k, a+n);
fout << a[k];
}