From 3cf1f533cc74f6369ef7e22e0f3867ec54e4c5a5 Mon Sep 17 00:00:00 2001 From: LiiNi-coder <97495437+LiiNi-coder@users.noreply.github.com> Date: Wed, 10 Dec 2025 23:20:38 +0900 Subject: [PATCH] =?UTF-8?q?[20251210]=20PGM=20/=20LV2=20/=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EA=B0=9C=EB=B0=9C=20/=20=EC=9D=B4=EC=9D=B8?= =?UTF-8?q?=ED=9D=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...60\353\212\245\352\260\234\353\260\234.md" | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 "LiiNi-coder/202512/10 PGM \352\270\260\353\212\245\352\260\234\353\260\234.md" diff --git "a/LiiNi-coder/202512/10 PGM \352\270\260\353\212\245\352\260\234\353\260\234.md" "b/LiiNi-coder/202512/10 PGM \352\270\260\353\212\245\352\260\234\353\260\234.md" new file mode 100644 index 00000000..bbbd8348 --- /dev/null +++ "b/LiiNi-coder/202512/10 PGM \352\270\260\353\212\245\352\260\234\353\260\234.md" @@ -0,0 +1,43 @@ +```java +import java.util.*; + +class Solution { + public int[] solution(int[] progresses, int[] speeds) { + int n = progresses.length; + int[] days = new int[n]; + + for(int i = 0; i < n; i++){ + int remain = 100 - progresses[i]; + if(remain % speeds[i] == 0){ + days[i] = remain / speeds[i] + 0; + }else{ + days[i] = remain / speeds[i] + 1; + } + } + List result = new ArrayList<>(); + int preDay = days[0]; + int count = 1; + for(int i = 1; i < n; i++){ + if(days[i] <= preDay){ + count++; + } else { + result.add(count); + preDay = days[i]; + count = 1; + } + } + + result.add(count); + + int[] answer = new int[result.size()]; + for(int i = 0; i < result.size(); i++){ + answer[i] = result.get(i); + } + + + + return answer; + } +} + +```