Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 안드로이드
- utility
- Algorithm
- hackerrank
- 백트랙
- backtrack5
- BOJ
- modern C++
- setting
- 2018 KAKAO BLIND RECRUITMENT
- RAII
- unique_ptr
- Android
- 2019 카카오 개발자 겨울 인턴십
Archives
- Today
- Total
K-D²
백준 11004 본문
#include <bits/stdc++.h>
using namespace std;
int N, K;
int num[5000005];
int main() {
ios::sync_with_stdio(false), cin.tie(nullptr);
cout.tie(nullptr);
cin >> N >> K;
for (int i = 0; i != N; ++i) {
cin >> num[i];
}
nth_element(num, num + K - 1, num + N);
cout << num[K - 1];
return 0;
}
Comments