From 1482748c96bbe940a5df05841cf4479c18be600e Mon Sep 17 00:00:00 2001 From: wldy4627 Date: Sun, 7 Jun 2026 04:46:46 +0900 Subject: [PATCH 1/3] =?UTF-8?q?42week:=20PROG[12987]=20=EC=88=AB=EC=9E=90?= =?UTF-8?q?=20=EA=B2=8C=EC=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wldy4627/Main.java" | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 "PROGRAMMERS/[12987] \354\210\253\354\236\220 \352\262\214\354\236\204/wldy4627/Main.java" diff --git "a/PROGRAMMERS/[12987] \354\210\253\354\236\220 \352\262\214\354\236\204/wldy4627/Main.java" "b/PROGRAMMERS/[12987] \354\210\253\354\236\220 \352\262\214\354\236\204/wldy4627/Main.java" new file mode 100644 index 0000000..9744872 --- /dev/null +++ "b/PROGRAMMERS/[12987] \354\210\253\354\236\220 \352\262\214\354\236\204/wldy4627/Main.java" @@ -0,0 +1,23 @@ +package proj.p12987.wldy4627; + +import java.util.Arrays; + +public class Main { + class Solution { + public int solution(int[] A, int[] B) { + int answer = 0; + + Arrays.sort(A); + Arrays.sort(B); + + int aIndex = 0; + for (int i = 0; i < B.length; i++) { + if (A[aIndex] < B[i]) { + answer++; + aIndex++; + } + } + return answer; + } + } +} From e93714a44f34f2c2b8c9657f7252421f14d876bc Mon Sep 17 00:00:00 2001 From: wldy4627 Date: Sun, 7 Jun 2026 04:59:27 +0900 Subject: [PATCH 2/3] =?UTF-8?q?42week:=20PROG[42884]=20=EB=8B=A8=EC=86=8D?= =?UTF-8?q?=EC=B9=B4=EB=A9=94=EB=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wldy4627/Main.java" | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 "PROGRAMMERS/[42884] \353\213\250\354\206\215\354\271\264\353\251\224\353\235\274/wldy4627/Main.java" diff --git "a/PROGRAMMERS/[42884] \353\213\250\354\206\215\354\271\264\353\251\224\353\235\274/wldy4627/Main.java" "b/PROGRAMMERS/[42884] \353\213\250\354\206\215\354\271\264\353\251\224\353\235\274/wldy4627/Main.java" new file mode 100644 index 0000000..6f0747a --- /dev/null +++ "b/PROGRAMMERS/[42884] \353\213\250\354\206\215\354\271\264\353\251\224\353\235\274/wldy4627/Main.java" @@ -0,0 +1,24 @@ +package prog.p42884.wldy4627; + +import java.util.Arrays; + +public class Main { + class Solution { + public int solution(int[][] routes) { + int answer = 0; + + Arrays.sort(routes, (o1, o2) -> Integer.compare(o1[1], o2[1])); + int camera = routes[0][1]; + answer++; + + for (int i = 1; i < routes.length; i++) { + if (camera < routes[i][0] || camera > routes[i][1]) { + answer++; + camera = routes[i][1]; + } + } + + return answer; + } + } +} From 2b6aaa4e0048a00c2750dca6ccc6930d771a3e98 Mon Sep 17 00:00:00 2001 From: wldy4627 Date: Sun, 7 Jun 2026 05:11:12 +0900 Subject: [PATCH 3/3] =?UTF-8?q?42week:=20PROG[12938]=20=EC=B5=9C=EA=B3=A0?= =?UTF-8?q?=EC=9D=98=20=EC=A7=91=ED=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wldy4627/Main.java" | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 "PROGRAMMERS/[12938] \354\265\234\352\263\240\354\235\230 \354\247\221\355\225\251/wldy4627/Main.java" diff --git "a/PROGRAMMERS/[12938] \354\265\234\352\263\240\354\235\230 \354\247\221\355\225\251/wldy4627/Main.java" "b/PROGRAMMERS/[12938] \354\265\234\352\263\240\354\235\230 \354\247\221\355\225\251/wldy4627/Main.java" new file mode 100644 index 0000000..da84c08 --- /dev/null +++ "b/PROGRAMMERS/[12938] \354\265\234\352\263\240\354\235\230 \354\247\221\355\225\251/wldy4627/Main.java" @@ -0,0 +1,29 @@ +package prog.p12938.wldy4627; + +public class Main { + class Solution { + public int[] solution(int n, int s) { + int[] answer = {}; + + if (s < n) { + return new int[]{-1}; + } + + answer = new int[n]; + + int num = s / n; + for (int i = 0; i < n; i++) { + answer[i] = num; + } + + int remainder = s % n; + if (remainder > 0) { + for (int i = 1; i <= remainder; i++) { + answer[n - i]++; + } + } + + return answer; + } + } +}