File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ # [ Bronze II] 커트라인 - 25305
2
+
3
+ [ 문제 링크] ( https://www.acmicpc.net/problem/25305 )
4
+
5
+ ### 성능 요약
6
+
7
+ 메모리: 18844 KB, 시간: 240 ms
8
+
9
+ ### 분류
10
+
11
+ 구현(implementation), 정렬(sorting)
12
+
13
+ ### 문제 설명
14
+
15
+ <p >2022 연세대학교 미래캠퍼스 슬기로운 코딩생활에 $N$명의 학생들이 응시했다.</p >
16
+
17
+ <p >이들 중 점수가 가장 높은 $k$명은 상을 받을 것이다. 이 때, 상을 받는 커트라인이 몇 점인지 구하라.</p >
18
+
19
+ <p >커트라인이란 상을 받는 사람들 중 점수가 가장 가장 낮은 사람의 점수를 말한다.</p >
20
+
21
+ ### 입력
22
+
23
+ <p >첫째 줄에는 응시자의 수 $N$과 상을 받는 사람의 수 $k$가 공백을 사이에 두고 주어진다.</p >
24
+
25
+ <p >둘째 줄에는 각 학생의 점수 $x$가 공백을 사이에 두고 주어진다.</p >
26
+
27
+ ### 출력
28
+
29
+ <p >상을 받는 커트라인을 출력하라.</p >
30
+
Original file line number Diff line number Diff line change
1
+ import java .io .*;
2
+ import java .util .Arrays ;
3
+ import java .util .StringTokenizer ;
4
+
5
+ public class Main {
6
+ public static void main (String [] args ) throws IOException {
7
+ BufferedReader br = new BufferedReader (new InputStreamReader (System .in ));
8
+ StringTokenizer st = new StringTokenizer (br .readLine ());
9
+ int N = Integer .parseInt (st .nextToken ());
10
+ int k = Integer .parseInt (st .nextToken ());
11
+ String [] arr = br .readLine ().split (" " );
12
+ int [] arrNum = Arrays .stream (arr ).mapToInt (Integer ::parseInt ).toArray ();
13
+
14
+ Arrays .sort (arrNum );
15
+ System .out .println (arrNum [N - k ]);
16
+ }
17
+ }
You can’t perform that action at this time.
0 commit comments