From cc72bbe9dd9f41f544765edbff9c90c3866de7f5 Mon Sep 17 00:00:00 2001 From: gayo73 <163620291+gayo73@users.noreply.github.com> Date: Sun, 19 Jul 2026 12:31:41 +0900 Subject: [PATCH] =?UTF-8?q?Add=20:=ED=98=B8=ED=85=94=5F=EB=8C=80=EC=8B=A4.?= =?UTF-8?q?java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...355\205\224_\353\214\200\354\213\244.java" | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 "Programmers/Gayo/\355\230\270\355\205\224_\353\214\200\354\213\244.java" diff --git "a/Programmers/Gayo/\355\230\270\355\205\224_\353\214\200\354\213\244.java" "b/Programmers/Gayo/\355\230\270\355\205\224_\353\214\200\354\213\244.java" new file mode 100644 index 0000000..248c7e2 --- /dev/null +++ "b/Programmers/Gayo/\355\230\270\355\205\224_\353\214\200\354\213\244.java" @@ -0,0 +1,43 @@ +import java.util.*; + +class Solution { + public int solution(String[][] book_time) { + int answer = 0; + // 손님 대기열 (입실 빠른 순) + PriorityQueue pq = new PriorityQueue<>((a, b)->{ + if(a[0]==b[0]) return Integer.compare(a[1], b[1]); + else return Integer.compare(a[0], b[0]); + }); + // 객실 관리 (종료시간 기록) + PriorityQueue arr = new PriorityQueue<>(); + + + for(int i=0; icur[0]){ + arr.add(cur[1]); + } + } + answer = arr.size(); + return answer; + } + + // 문자열 시간, 분을 분 단위 정수로 변환 + public int CalTime(int i, int n, String[][] book_time){ + String[] splitTime = book_time[i][n].split(":"); + int hour = Integer.parseInt(splitTime[0]); + int min = Integer.parseInt(splitTime[1]); + int total = hour*60 + min; + return total; + } +} \ No newline at end of file