VioletaBabel
11004번: K번째 수 본문
#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int main()
{
int n, k, num[5000000];
cin >> n >> k;
for (int i = 0; i < n; ++i)
scanf("%d", &num[i]);
sort(num, num + n);
cout << num[k - 1];
}
'백준 > 백준-C++' 카테고리의 다른 글
| 1978번: 소수 찾기 (0) | 2017.05.26 |
|---|---|
| 10866번: 덱 (0) | 2017.05.26 |
| 10828번: 스택 (0) | 2017.05.26 |
| 1406번: 에디터 (0) | 2017.05.26 |
| 1158번: 조세퍼스 문제 (0) | 2017.05.26 |
Comments