2024.05.30 ( Java )

changi123·2024년 5월 30일
0
post-thumbnail

1. N번째 큰 수

Queue ( https://www.acmicpc.net/problem/2075 )

GitHub -> https://github.com/changi123/Algorithm-And-Data_structure/blob/main/Algorithm/src/problem_solving/queue/BaekJoon_2075.java
package problem_solving.queue;

import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Scanner;

public class BaekJoon_2075 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		PriorityQueue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder());
		int powerN = n*n;
		while( powerN -- >0) {
			pq.offer(Integer.parseInt(sc.next()));
		}
		
		while(n-- > 1 ) {
			pq.poll();
		}
		System.out.println(pq.poll());
	}

}

2. 백준 레벨 변동

  • Gold 5 29% -> Gold 5 32%

3. 풀이 유형

  • Queue - 1문제
  • 마지막 문제 풀고 업데이트 하자
profile
개발자 홍찬기 꾸준한 사람이 되자

0개의 댓글

관련 채용 정보