-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy path2075.java
More file actions
31 lines (26 loc) · 848 Bytes
/
Copy path2075.java
File metadata and controls
31 lines (26 loc) · 848 Bytes
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
// Copyright@2023 Jihoon Lucas Kim <jihoon.lucas.kim@gmail.com>
// N번째 큰 수
// https://www.acmicpc.net/problem/2075
// 힌트
// 1. 모든 수에 대해 정렬 후 끝에서 N번째 인자 출력
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
int[] v = new int[N * N];
StringTokenizer st;
for (int i = 0; i < N ; i++) {
st = new StringTokenizer(br.readLine());
for (int j = 0 ; j < N; j++) {
v[i*N + j] = Integer.parseInt(st.nextToken());
}
}
Arrays.sort(v);
System.out.println(v[N * N - N]);
}
}