Skip to content

Commit 4fcee6c

Browse files
committed
Solve 2381 - Call List in c++
1 parent b4b254f commit 4fcee6c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

solutions/beecrowd/2381/2381.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <algorithm>
2+
#include <cstdint>
3+
#include <iostream>
4+
#include <string>
5+
6+
int main() {
7+
std::ios_base::sync_with_stdio(false);
8+
std::cin.tie(0);
9+
10+
int16_t n, k;
11+
12+
while (std::cin >> n >> k) {
13+
std::string names[n];
14+
for (int16_t i = 0; i < n; i++) {
15+
std::cin >> names[i];
16+
}
17+
std::sort(names, names + n);
18+
19+
std::cout << names[k - 1] << '\n';
20+
}
21+
22+
return 0;
23+
}

0 commit comments

Comments
 (0)