diff --git "a/solution/BOJ_2075_N\353\262\210\354\247\270-\355\201\260\354\210\230/\354\265\234\355\225\230\353\235\274.java" "b/solution/BOJ_2075_N\353\262\210\354\247\270-\355\201\260\354\210\230/\354\265\234\355\225\230\353\235\274.java" new file mode 100644 index 0000000..c3eb561 --- /dev/null +++ "b/solution/BOJ_2075_N\353\262\210\354\247\270-\355\201\260\354\210\230/\354\265\234\355\225\230\353\235\274.java" @@ -0,0 +1,26 @@ +import java.io.*; +import java.util.*; + +public class Main { + public static void main(String[] args) throws Exception { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + int N = Integer.parseInt(br.readLine()); + + PriorityQueue pq = new PriorityQueue<>(); + for (int i = 0; i < N; i++) { + StringTokenizer st = new StringTokenizer(br.readLine()); + for (int j = 0; j < N; j++) { + int input = Integer.parseInt(st.nextToken()); + if (pq.size() == N) { + if (pq.peek() < input) { + pq.add(input); + pq.poll(); + } + } else { + pq.add(input); + } + } + } + System.out.println(pq.poll()); + } +} \ No newline at end of file