From 7eccea3e68dc2086a3446292d1d51595e091a51e Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年10月14日 13:29:32 +0900 Subject: [PATCH 01/10] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[CT]=20?= =?UTF-8?q?=ED=85=8C=ED=8A=B8=EB=A6=AC=EC=8A=A4=20=EB=B8=94=EB=9F=AD=20?= =?UTF-8?q?=EC=95=88=EC=9D=98=20=ED=95=A9=20=EC=B5=9C=EB=8C=80=ED=99=94=20?= =?UTF-8?q?=ED=95=98=EA=B8=B0=5F241014?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...355231円224円_355円225円230円352円270円260円.java" | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 "CodeTree/2017-2018353円205円204円/JY_355円205円214円355円212円270円353円246円254円354円212円244円_353円270円224円353円237円255円_354円225円210円354円235円230円_355円225円251円_354円265円234円353円214円200円355円231円224円_355円225円230円352円270円260円.java" diff --git "a/CodeTree/2017-2018353円205円204円/JY_355円205円214円355円212円270円353円246円254円354円212円244円_353円270円224円353円237円255円_354円225円210円354円235円230円_355円225円251円_354円265円234円353円214円200円355円231円224円_355円225円230円352円270円260円.java" "b/CodeTree/2017-2018353円205円204円/JY_355円205円214円355円212円270円353円246円254円354円212円244円_353円270円224円353円237円255円_354円225円210円354円235円230円_355円225円251円_354円265円234円353円214円200円355円231円224円_355円225円230円352円270円260円.java" new file mode 100644 index 00000000..d9db61be --- /dev/null +++ "b/CodeTree/2017-2018353円205円204円/JY_355円205円214円355円212円270円353円246円254円354円212円244円_353円270円224円353円237円255円_354円225円210円354円235円230円_355円225円251円_354円265円234円353円214円200円355円231円224円_355円225円230円352円270円260円.java" @@ -0,0 +1,81 @@ +package day1014; + +import java.util.*; +import java.io.*; + +public class JY_테트리스_블럭_안의_합_최대화_하기 { + + static int N, M; + static int[][] g; + static boolean[][] visited; + static int ans; + // 현재 그래프 값 중 가장 큰 것 + static int maxValue; + static int[] dx = {0, 0, -1, 1}; + static int[] dy = {-1, 1, 0, 0}; + + + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + StringTokenizer st = new StringTokenizer(br.readLine()); + + N = Integer.parseInt(st.nextToken()); + M = Integer.parseInt(st.nextToken()); + + g = new int[N][M]; + maxValue = Integer.MIN_VALUE; + for(int i=0; i=0 && x=0 && y= total+maxValue*(4-depth)) return; + + for(int i=0; i<4; i++) { + int nx = x + dx[i]; + int ny = y + dy[i]; + if(!inRange(nx, ny)) continue; + if(visited[nx][ny]) continue; + // 2번째 블럭인 경우, ᅡ ᅥ ᅩ ᅮ 처럼 2번째 블록에서 연결된 2개의 블록을 찾아야한다. + if(depth == 2) { + visited[nx][ny] = true; + dfs(x, y, depth+1, total+g[nx][ny]); + visited[nx][ny] = false; + } + + // 2번쨰 블록 이외에는 일반탐색 + visited[nx][ny] = true; + dfs(nx, ny, depth+1, total+g[nx][ny]); + visited[nx][ny] = false; + + } + } + +} From eff4a9560f4512310f5d25ad20fee33462969bf3 Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年10月15日 10:03:51 +0900 Subject: [PATCH 02/10] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[BOJ]=2028?= =?UTF-8?q?05=20=EB=82=98=EB=AC=B4=20=EC=9E=90=EB=A5=B4=EA=B8=B0=5F241015?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "BOJ/1000-5000353円262円210円/JY_2805.java" | 48 ++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 "BOJ/1000-5000353円262円210円/JY_2805.java" diff --git "a/BOJ/1000-5000353円262円210円/JY_2805.java" "b/BOJ/1000-5000353円262円210円/JY_2805.java" new file mode 100644 index 00000000..a0e6aa25 --- /dev/null +++ "b/BOJ/1000-5000353円262円210円/JY_2805.java" @@ -0,0 +1,48 @@ +package day1015; + +import java.util.*; +import java.io.*; + +public class JY_2805 { + + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + StringTokenizer st = new StringTokenizer(br.readLine()); + + int N = Integer.parseInt(st.nextToken()); + int M = Integer.parseInt(st.nextToken()); + + int[] trr = new int[N]; + int maxH = Integer.MIN_VALUE; + st = new StringTokenizer(br.readLine()); + for(int i=0; i mid) total += (trr[i]-mid); + } + + // 자른길이가 M보다 작다면 높이를 더 낮게 설정해서 자른길이의 합을 늘려야 함 + if(total < M) { + e = mid - 1; + } else { + ans = mid; + s = mid + 1; + } + } + + System.out.println(ans); + + } + +} From 98a4edeb809fa817bb5661b10bbd5f5c225cfe44 Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年10月15日 10:04:39 +0900 Subject: [PATCH 03/10] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[BOJ]=2021?= =?UTF-8?q?10=20=EA=B3=B5=EC=9C=A0=EA=B8=B0=20=EC=84=A4=EC=B9=98=5F241015?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "BOJ/1000-5000353円262円210円/JY_2110.java" | 55 ++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 "BOJ/1000-5000353円262円210円/JY_2110.java" diff --git "a/BOJ/1000-5000353円262円210円/JY_2110.java" "b/BOJ/1000-5000353円262円210円/JY_2110.java" new file mode 100644 index 00000000..9b4723bd --- /dev/null +++ "b/BOJ/1000-5000353円262円210円/JY_2110.java" @@ -0,0 +1,55 @@ +package day1015; + +import java.util.*; +import java.io.*; + +public class JY_2110 { + + static int N, C; + static long[] wrr; + + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + StringTokenizer st = new StringTokenizer(br.readLine()); + + N = Integer.parseInt(st.nextToken()); + C = Integer.parseInt(st.nextToken()); + + wrr = new long[N]; + for(int i=0; i= nextPos) { + nextPos = wrr[i] + mid; + cnt++; + } + } + + // 필요한 공유기수가 더 많거나 같으면 거리를 늘릴 수 있음 + if(cnt>= C) { + s = mid + 1; + } + // 필요한 공유기수가 더 작으면 거리를 좁혀야 함 + else { + e = mid; + } + } + + System.out.println(e); + } + +} From 92c2344283cc43d9ed2c277a7a736e2a39c42c43 Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年10月16日 14:18:09 +0900 Subject: [PATCH 04/10] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[BOJ]=2075?= =?UTF-8?q?79=20=EC=95=B1=5F241016?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "BOJ/5001-10000353円262円210円/JY_7579.java" | 54 +++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 "BOJ/5001-10000353円262円210円/JY_7579.java" diff --git "a/BOJ/5001-10000353円262円210円/JY_7579.java" "b/BOJ/5001-10000353円262円210円/JY_7579.java" new file mode 100644 index 00000000..80d6031d --- /dev/null +++ "b/BOJ/5001-10000353円262円210円/JY_7579.java" @@ -0,0 +1,54 @@ +package day1016; + +import java.util.*; +import java.io.*; + +public class JY_7579 { + + // 최대 비용(100개 * 100) + static int MAX_COST = 10001; + + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + StringTokenizer st = new StringTokenizer(br.readLine()); + + int N = Integer.parseInt(st.nextToken()); + int M = Integer.parseInt(st.nextToken()); + + int[] mrr = new int[N+1]; + st = new StringTokenizer(br.readLine()); + for(int i=1; i= M) { + ans = j; + break; + } + } + + System.out.println(ans); + } + +} From 9f0ae357c81ffd5421b8fd7c16ea16061c50e270 Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年10月16日 14:48:46 +0900 Subject: [PATCH 05/10] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[BOJ]=2090?= =?UTF-8?q?84=20=EB=8F=99=EC=A0=84=5F241016?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "BOJ/5001-10000353円262円210円/JY_9084.java" | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 "BOJ/5001-10000353円262円210円/JY_9084.java" diff --git "a/BOJ/5001-10000353円262円210円/JY_9084.java" "b/BOJ/5001-10000353円262円210円/JY_9084.java" new file mode 100644 index 00000000..95c3fe92 --- /dev/null +++ "b/BOJ/5001-10000353円262円210円/JY_9084.java" @@ -0,0 +1,44 @@ +package day1016; + +import java.util.*; +import java.io.*; + +public class JY_9084 { + + static int MAX_COST = 10001; + + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + StringTokenizer st = new StringTokenizer(br.readLine()); + + int T = Integer.parseInt(st.nextToken()); + for(int t=0; t Date: 2024年10月17日 09:32:32 +0900 Subject: [PATCH 06/10] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[PG]=20432?= =?UTF-8?q?38=20=EC=9E=85=EA=B5=AD=EC=8B=AC=EC=82=AC=5F241017?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Programmers/Level3/JY_43238.java | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Programmers/Level3/JY_43238.java diff --git a/Programmers/Level3/JY_43238.java b/Programmers/Level3/JY_43238.java new file mode 100644 index 00000000..39a78033 --- /dev/null +++ b/Programmers/Level3/JY_43238.java @@ -0,0 +1,41 @@ +class Solution { + public long solution(int n, int[] times) { + long answer = 0; + int T = times.length; + + // 가장 시간이 오래걸리는 심사관 + long maxTime = 0; + for(int i=0; i n) break; + } + return total; + } +} \ No newline at end of file From 6356a27a270696609ca0b6af7ff367252ac6b1ee Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年10月17日 09:56:10 +0900 Subject: [PATCH 07/10] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[SQL]=20?= =?UTF-8?q?=EB=8C=80=EC=9E=A5=EA=B7=A0=EB=93=A4=EC=9D=98=20=EC=9E=90?= =?UTF-8?q?=EC=8B=9D=EC=9D=98=20=EC=88=98=20=EA=B5=AC=ED=95=98=EA=B8=B0=5F?= =?UTF-8?q?241015?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...354210円230円_352円265円254円355円225円230円352円270円260円.sql" | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 "SQL/06354円243円274円354円260円250円/JY_353円214円200円354円236円245円352円267円240円353円223円244円354円235円230円_354円236円220円354円213円235円354円235円230円_354円210円230円_352円265円254円355円225円230円352円270円260円.sql" diff --git "a/SQL/06354円243円274円354円260円250円/JY_353円214円200円354円236円245円352円267円240円353円223円244円354円235円230円_354円236円220円354円213円235円354円235円230円_354円210円230円_352円265円254円355円225円230円352円270円260円.sql" "b/SQL/06354円243円274円354円260円250円/JY_353円214円200円354円236円245円352円267円240円353円223円244円354円235円230円_354円236円220円354円213円235円354円235円230円_354円210円230円_352円265円254円355円225円230円352円270円260円.sql" new file mode 100644 index 00000000..aac11bc5 --- /dev/null +++ "b/SQL/06354円243円274円354円260円250円/JY_353円214円200円354円236円245円352円267円240円353円223円244円354円235円230円_354円236円220円354円213円235円354円235円230円_354円210円230円_352円265円254円355円225円230円352円270円260円.sql" @@ -0,0 +1,9 @@ +-- 대장균 자식의 수 구하기 +-- https://school.programmers.co.kr/learn/courses/30/lessons/299305 + +SELECT P.ID, COUNT(C.ID) AS CHILD_COUNT +FROM ECOLI_DATA P +LEFT JOIN ECOLI_DATA C +ON P.ID = C.PARENT_ID +GROUP BY(P.ID) +ORDER BY P.ID; From 4d78ddecdbc95f28d8496e957f3253aac4687662 Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年10月17日 10:04:31 +0900 Subject: [PATCH 08/10] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[SQL]=20?= =?UTF-8?q?=EC=9E=AC=EA=B5=AC=EB=A7=A4=EA=B0=80=20=EC=9D=BC=EC=96=B4?= =?UTF-8?q?=EB=82=9C=20=EC=83=81=ED=92=88=EA=B3=BC=20=ED=9A=8C=EC=9B=90=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EA=B5=AC=ED=95=98=EA=B8=B0=5F241?= =?UTF-8?q?017?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...355円212円270円_352円265円254円355円225円230円352円270円260円.sql" | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 "SQL/06354円243円274円354円260円250円/JY_354円236円254円352円265円254円353円247円244円352円260円200円_354円235円274円354円226円264円353円202円234円_354円203円201円355円222円210円352円263円274円_355円232円214円354円233円220円_353円246円254円354円212円244円355円212円270円_352円265円254円355円225円230円352円270円260円.sql" diff --git "a/SQL/06354円243円274円354円260円250円/JY_354円236円254円352円265円254円353円247円244円352円260円200円_354円235円274円354円226円264円353円202円234円_354円203円201円355円222円210円352円263円274円_355円232円214円354円233円220円_353円246円254円354円212円244円355円212円270円_352円265円254円355円225円230円352円270円260円.sql" "b/SQL/06354円243円274円354円260円250円/JY_354円236円254円352円265円254円353円247円244円352円260円200円_354円235円274円354円226円264円353円202円234円_354円203円201円355円222円210円352円263円274円_355円232円214円354円233円220円_353円246円254円354円212円244円355円212円270円_352円265円254円355円225円230円352円270円260円.sql" new file mode 100644 index 00000000..05f0ce24 --- /dev/null +++ "b/SQL/06354円243円274円354円260円250円/JY_354円236円254円352円265円254円353円247円244円352円260円200円_354円235円274円354円226円264円353円202円234円_354円203円201円355円222円210円352円263円274円_355円232円214円354円233円220円_353円246円254円354円212円244円355円212円270円_352円265円254円355円225円230円352円270円260円.sql" @@ -0,0 +1,8 @@ +-- 재구매가 일어난 상품과 회원 리스트 구하기 +-- https://school.programmers.co.kr/learn/courses/30/lessons/131536 + +SELECT USER_ID, PRODUCT_ID +FROM ONLINE_SALE +GROUP BY USER_ID, PRODUCT_ID +HAVING COUNT(USER_ID)>= 2 +ORDER BY USER_ID, PRODUCT_ID DESC \ No newline at end of file From a4bb43beb1264e3c8fb88932e7284ccdd695aba3 Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年10月17日 23:08:57 +0900 Subject: [PATCH 09/10] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[SQL]=20?= =?UTF-8?q?=EC=A3=BC=EB=AC=B8=EB=9F=89=EC=9D=B4=20=EB=A7=8E=EC=9D=80=20?= =?UTF-8?q?=EC=95=84=EC=9D=B4=EC=8A=A4=ED=81=AC=EB=A6=BC=EB=93=A4=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=ED=95=98=EA=B8=B0=5F241017?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...54241円260円355円232円214円355円225円230円352円270円260円.sql" | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 "SQL/06354円243円274円354円260円250円/JY_354円243円274円353円254円270円353円237円211円354円235円264円_353円247円216円354円235円200円_354円225円204円354円235円264円354円212円244円355円201円254円353円246円274円353円223円244円_354円241円260円355円232円214円355円225円230円352円270円260円.sql" diff --git "a/SQL/06354円243円274円354円260円250円/JY_354円243円274円353円254円270円353円237円211円354円235円264円_353円247円216円354円235円200円_354円225円204円354円235円264円354円212円244円355円201円254円353円246円274円353円223円244円_354円241円260円355円232円214円355円225円230円352円270円260円.sql" "b/SQL/06354円243円274円354円260円250円/JY_354円243円274円353円254円270円353円237円211円354円235円264円_353円247円216円354円235円200円_354円225円204円354円235円264円354円212円244円355円201円254円353円246円274円353円223円244円_354円241円260円355円232円214円355円225円230円352円270円260円.sql" new file mode 100644 index 00000000..fac1ae5b --- /dev/null +++ "b/SQL/06354円243円274円354円260円250円/JY_354円243円274円353円254円270円353円237円211円354円235円264円_353円247円216円354円235円200円_354円225円204円354円235円264円354円212円244円355円201円254円353円246円274円353円223円244円_354円241円260円355円232円214円355円225円230円352円270円260円.sql" @@ -0,0 +1,10 @@ +-- 주문량이 많은 아이스크림들 조회하기 +-- https://school.programmers.co.kr/learn/courses/30/lessons/133027 + +SELECT J.FLAVOR +FROM JULY J +LEFT JOIN FIRST_HALF F +ON J.FLAVOR = F.FLAVOR +GROUP BY J.FLAVOR +ORDER BY SUM(J.TOTAL_ORDER)+SUM(F.TOTAL_ORDER) DESC +LIMIT 3 \ No newline at end of file From 92855e8803f382335aa66991460290071105f17f Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年10月18日 09:37:47 +0900 Subject: [PATCH 10/10] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[PG]=20428?= =?UTF-8?q?61=20=EC=84=AC=20=EC=97=B0=EA=B2=B0=ED=95=98=EA=B8=B0=5F241018?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Programmers/Level3/JY_42861.java | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Programmers/Level3/JY_42861.java diff --git a/Programmers/Level3/JY_42861.java b/Programmers/Level3/JY_42861.java new file mode 100644 index 00000000..b326c292 --- /dev/null +++ b/Programmers/Level3/JY_42861.java @@ -0,0 +1,41 @@ +import java.util.*; + +class Solution { + + static int[] parents; + + public int solution(int n, int[][] costs) { + int answer = 0; + + parents = new int[n]; + for(int i=0; i(o1[2]-o2[2])); + + for(int[] cost: costs) { + if(find(cost[0]) != find(cost[1])) { + union(cost[0], cost[1]); + answer += cost[2]; + } + } + + return answer; + } + public static int find(int x) { + if(parents[x] != x) { + parents[x] = find(parents[x]); + } + return parents[x]; + } + public static void union(int a, int b) { + int pa = find(a); + int pb = find(b); + + if(pa != pb) { + parents[pb] = pa; + } + } +} \ No newline at end of file

AltStyle によって変換されたページ (->オリジナル) /