From 00839084a8fc0b4d16710e33f799cc026ae09626 Mon Sep 17 00:00:00 2001 From: siwon Date: Tue, 27 Jan 2026 15:41:00 +0900 Subject: [PATCH 1/4] =?UTF-8?q?solve:=20=EB=B0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../[BOJ] \353\260\260/Mun.java" | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 "01\354\233\224/4\354\243\274\354\260\250/[BOJ] \353\260\260/Mun.java" diff --git "a/01\354\233\224/4\354\243\274\354\260\250/[BOJ] \353\260\260/Mun.java" "b/01\354\233\224/4\354\243\274\354\260\250/[BOJ] \353\260\260/Mun.java" new file mode 100644 index 0000000..fd1dc4e --- /dev/null +++ "b/01\354\233\224/4\354\243\274\354\260\250/[BOJ] \353\260\260/Mun.java" @@ -0,0 +1,42 @@ +import java.io.*; +import java.util.*; + +public class Mun { + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + ArrayList crane = new ArrayList<>(); + ArrayList box = new ArrayList<>(); + + int N = Integer.parseInt(br.readLine()); + String[] c_input = br.readLine().split(" "); + for(String c : c_input) { + crane.add(Integer.parseInt(c)); + } + int M = Integer.parseInt(br.readLine()); + String[] b_input = br.readLine().split(" "); + for(String b : b_input) { + box.add(Integer.parseInt(b)); + } + + Collections.sort(crane, Collections.reverseOrder()); + Collections.sort(box, Collections.reverseOrder()); + + if(crane.get(0) < box.get(0)) { + System.out.print(-1); + return; + } + int time = 0; + while(box.size() > 0) { + time++; + for(int cSize : crane) { + for(int i=0;i= box.get(i)) { + box.remove(i); + break; + } + } + } + } + System.out.print(time); + } +} From 05e614d4bb6c3bfa20a730258d62de5a8e305840 Mon Sep 17 00:00:00 2001 From: siwon Date: Tue, 27 Jan 2026 15:41:13 +0900 Subject: [PATCH 2/4] =?UTF-8?q?solve:=20=EC=9D=8C=ED=95=98=EC=B2=A0?= =?UTF-8?q?=EB=8F=84=20=EA=B5=AC=EA=B5=AC=ED=8C=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mun.java" | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 "01\354\233\224/4\354\243\274\354\260\250/[BOJ] \354\235\214\355\225\230\354\262\240\353\217\204 \352\265\254\352\265\254\355\214\224/Mun.java" diff --git "a/01\354\233\224/4\354\243\274\354\260\250/[BOJ] \354\235\214\355\225\230\354\262\240\353\217\204 \352\265\254\352\265\254\355\214\224/Mun.java" "b/01\354\233\224/4\354\243\274\354\260\250/[BOJ] \354\235\214\355\225\230\354\262\240\353\217\204 \352\265\254\352\265\254\355\214\224/Mun.java" new file mode 100644 index 0000000..8d6de5f --- /dev/null +++ "b/01\354\233\224/4\354\243\274\354\260\250/[BOJ] \354\235\214\355\225\230\354\262\240\353\217\204 \352\265\254\352\265\254\355\214\224/Mun.java" @@ -0,0 +1,46 @@ +import java.io.*; +public class Mun { + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + String[] station = br.readLine().split(" "); + int xs = Integer.parseInt(station[0]); + int ys = Integer.parseInt(station[1]); + String[] train = br.readLine().split(" "); + int xe = Integer.parseInt(train[0]); + int ye = Integer.parseInt(train[1]); + int dx = Integer.parseInt(train[2]); + int dy = Integer.parseInt(train[3]); + int gcd = getGcd(dx, dy); + dx /= gcd; + dy /= gcd; + double distance = getDis(xs, xe, ys, ye); + int x = 0; + int y = 0; + while(true) { + xe += dx; + ye += dy; + double dis = getDis(xs, xe, ys, ye); + if(distance > dis) { + distance = dis; + } else { + x = xe - dx; + y = ye - dy; + break; + } + } + System.out.print(x + " " + y); + } + + private static double getDis(int x1, int x2, int y1, int y2) { + return Math.sqrt(Math.pow((x2 - x1), 2) + Math.pow((y2 - y1), 2)); + } + + public static int getGcd(int a, int b) { + if(b == 0) { + return a; + } + return getGcd(b, a % b); + + } + +} \ No newline at end of file From 95de284c32c429acd564944fb0ecd6fed1c3fa5c Mon Sep 17 00:00:00 2001 From: siwon Date: Tue, 27 Jan 2026 15:41:26 +0900 Subject: [PATCH 3/4] =?UTF-8?q?solve:=20=EC=A2=8B=EC=9D=80=20=EA=B5=AC?= =?UTF-8?q?=EA=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mun.java" | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 "01\354\233\224/4\354\243\274\354\260\250/[BOJ] \354\242\213\354\235\200 \352\265\254\352\260\204/Mun.java" diff --git "a/01\354\233\224/4\354\243\274\354\260\250/[BOJ] \354\242\213\354\235\200 \352\265\254\352\260\204/Mun.java" "b/01\354\233\224/4\354\243\274\354\260\250/[BOJ] \354\242\213\354\235\200 \352\265\254\352\260\204/Mun.java" new file mode 100644 index 0000000..6239d3d --- /dev/null +++ "b/01\354\233\224/4\354\243\274\354\260\250/[BOJ] \354\242\213\354\235\200 \352\265\254\352\260\204/Mun.java" @@ -0,0 +1,37 @@ +import java.io.*; +import java.util.*; + +public class Mun { + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + int L = Integer.parseInt(br.readLine()); + int[] S = Arrays.stream(br.readLine().split(" ")) + .mapToInt(Integer::parseInt) + .sorted() + .toArray(); + int n = Integer.parseInt(br.readLine()); + int min = 0; + int max = S[L-1]; + for(int i=0;i= n) { + max = S[i]; + if(i > 0) { + min = S[i-1]; + } + break; + } + } + if(min == n || max == n) { + System.out.print(0); + return; + } + int count = 0; + for(int i=min+1;i<=n;i++) { + for(int j=n;j Date: Tue, 27 Jan 2026 15:41:40 +0900 Subject: [PATCH 4/4] =?UTF-8?q?solve:=20=ED=83=9D=EB=B0=B0=20=EB=B0=B0?= =?UTF-8?q?=EB=8B=AC=EA=B3=BC=20=EC=88=98=EA=B1=B0=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mun.java" | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 "01\354\233\224/4\354\243\274\354\260\250/[PRGRMS] \355\203\235\353\260\260 \353\260\260\353\213\254\352\263\274 \354\210\230\352\261\260\355\225\230\352\270\260/Mun.java" diff --git "a/01\354\233\224/4\354\243\274\354\260\250/[PRGRMS] \355\203\235\353\260\260 \353\260\260\353\213\254\352\263\274 \354\210\230\352\261\260\355\225\230\352\270\260/Mun.java" "b/01\354\233\224/4\354\243\274\354\260\250/[PRGRMS] \355\203\235\353\260\260 \353\260\260\353\213\254\352\263\274 \354\210\230\352\261\260\355\225\230\352\270\260/Mun.java" new file mode 100644 index 0000000..2b6a4d4 --- /dev/null +++ "b/01\354\233\224/4\354\243\274\354\260\250/[PRGRMS] \355\203\235\353\260\260 \353\260\260\353\213\254\352\263\274 \354\210\230\352\261\260\355\225\230\352\270\260/Mun.java" @@ -0,0 +1,39 @@ +class Mun { + + public long solution(int cap, int n, int[] deliveries, int[] pickups) { + long answer = 0; + int start = getStart(deliveries, pickups, n); + while(start >= 0) { + answer+=((start+1)*2); + start = Math.max(go(start, cap, deliveries), go(start, cap, pickups)); + } + return answer; + } + + private int go(int start, int cap, int[] arr) { + for(int i=start;i>=0;i--) { + if(arr[i] == 0) { + continue; + } + int a = arr[i]; + if(a <= cap) { + arr[i] = 0; + cap -= a; + continue; + } + arr[i]-=cap; + return i; + } + return -1; + } + + private int getStart(int[] a1, int[] a2, int n) { + for(int i=n-1;i>=0;i--) { + if(a1[i] > 0 || a2[i] > 0) { + return i; + } + } + return -1; + } + +} \ No newline at end of file