From aedc64454e7535d2912fa9bd7510e077d1d06617 Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年11月11日 11:06:39 +0900 Subject: [PATCH 1/9] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[CT]=20?= =?UTF-8?q?=ED=9A=8C=EC=A0=84=ED=95=98=EB=8A=94=20=EB=B9=99=ED=95=98=5F241?= =?UTF-8?q?111?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...353212円224円_353円271円231円355円225円230円.java" | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 "CodeTree/2019-2020353円205円204円/JY_355円232円214円354円240円204円355円225円230円353円212円224円_353円271円231円355円225円230円.java" diff --git "a/CodeTree/2019-2020353円205円204円/JY_355円232円214円354円240円204円355円225円230円353円212円224円_353円271円231円355円225円230円.java" "b/CodeTree/2019-2020353円205円204円/JY_355円232円214円354円240円204円355円225円230円353円212円224円_353円271円231円355円225円230円.java" new file mode 100644 index 00000000..d4a1cf4c --- /dev/null +++ "b/CodeTree/2019-2020353円205円204円/JY_355円232円214円354円240円204円355円225円230円353円212円224円_353円271円231円355円225円230円.java" @@ -0,0 +1,167 @@ +package day1111; + +import java.io.*; +import java.util.*; + +public class JY_회전하는_빙하 { + + static int n, N, Q; + static int[][] g, t; + static int[] dx = {0, 0, -1, 1}; + static int[] dy = {-1, 1, 0, 0}; + static boolean[][] visited; + + + 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()); + Q = Integer.parseInt(st.nextToken()); + + N = (int)Math.pow(2, n); + + g = new int[N][N]; + for(int i=0; i 0) { + int S = (int)Math.pow(2, r); + t = new int[N][N]; + + for(int i=0; i=0 && x=0 && y q = new LinkedList(); + q.add(new int[] {x, y}); + + while(!q.isEmpty()) { + int[] now = q.poll(); + + for(int i=0; i<4; i++) { + int nx = now[0] + dx[i]; + int ny = now[1] + dy[i]; + if(!inRange(nx, ny)) continue; + if(visited[nx][ny]) continue; + if(g[nx][ny] == 0) continue; + visited[nx][ny] = true; + q.add(new int[] {nx, ny}); + size++; + } + } + + return size; + } + +} From 30b308c34a210ec8085a14a3cbe9924c74e7b9f5 Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年11月13日 09:29:54 +0900 Subject: [PATCH 2/9] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[BOJ]=201613?= =?UTF-8?q?=20=EC=97=AD=EC=82=AC=5F241113?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "BOJ/1000-5000353円262円210円/JY_1613.java" | 68 ++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 "BOJ/1000-5000353円262円210円/JY_1613.java" diff --git "a/BOJ/1000-5000353円262円210円/JY_1613.java" "b/BOJ/1000-5000353円262円210円/JY_1613.java" new file mode 100644 index 00000000..fee3423f --- /dev/null +++ "b/BOJ/1000-5000353円262円210円/JY_1613.java" @@ -0,0 +1,68 @@ +package day1113; + +import java.io.*; +import java.util.*; + +public class JY_1613 { + + static final int INF = 50_000; + + 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 K = Integer.parseInt(st.nextToken()); + + int[][] g = new int[N+1][N+1]; + for(int i=0; i j로 갈 수 있는 최단거리 구함 + for(int k=1; k Date: 2024年11月13日 10:00:15 +0900 Subject: [PATCH 3/9] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[BOJ]=202096?= =?UTF-8?q?=20=EB=82=B4=EB=A0=A4=EA=B0=80=EA=B8=B0=5F241113?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "BOJ/1000-5000353円262円210円/JY_2096.java" | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 "BOJ/1000-5000353円262円210円/JY_2096.java" diff --git "a/BOJ/1000-5000353円262円210円/JY_2096.java" "b/BOJ/1000-5000353円262円210円/JY_2096.java" new file mode 100644 index 00000000..c596bcd0 --- /dev/null +++ "b/BOJ/1000-5000353円262円210円/JY_2096.java" @@ -0,0 +1,46 @@ +package day1113; + +import java.io.*; +import java.util.*; + +public class JY_2096 { + + 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[][] dp1 = new int[N][3]; + int[][] dp2 = new int[N][3]; + + for(int i=0; i Date: 2024年11月13日 10:26:22 +0900 Subject: [PATCH 4/9] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[SQL]=20Huma?= =?UTF-8?q?n=20Traffic=20of=20Stadium=5F241113?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JY_Human_Traffic_of_Stadium.sql" | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 "SQL/10354円243円274円354円260円250円/JY_Human_Traffic_of_Stadium.sql" diff --git "a/SQL/10354円243円274円354円260円250円/JY_Human_Traffic_of_Stadium.sql" "b/SQL/10354円243円274円354円260円250円/JY_Human_Traffic_of_Stadium.sql" new file mode 100644 index 00000000..eaa3fc89 --- /dev/null +++ "b/SQL/10354円243円274円354円260円250円/JY_Human_Traffic_of_Stadium.sql" @@ -0,0 +1,12 @@ +-- 601. Human Traffic of Stadium +-- https://leetcode.com/problems/human-traffic-of-stadium/ +WITH CTE AS( + SELECT *, ID- ROW_NUMBER() OVER() AS ID_DIFF + FROM STADIUM + WHERE PEOPLE> 99 +) + +SELECT ID, VISIT_DATE, PEOPLE +FROM CTE +WHERE ID_DIFF IN (SELECT ID_DIFF FROM CTE GROUP BY ID_DIFF HAVING COUNT(ID_DIFF)>= 3) +ORDER BY VISIT_DATE \ No newline at end of file From 3136eedeefa1486623c0e54e193743ca2f980c1c Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年11月13日 22:10:44 +0900 Subject: [PATCH 5/9] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[BOJ]=202955?= =?UTF-8?q?=20=EC=8A=A4=EB=8F=84=EC=BF=A0=20=ED=92=80=EA=B8=B0=5F241112?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "BOJ/1000-5000353円262円210円/JY_2955.java" | 194 +++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 "BOJ/1000-5000353円262円210円/JY_2955.java" diff --git "a/BOJ/1000-5000353円262円210円/JY_2955.java" "b/BOJ/1000-5000353円262円210円/JY_2955.java" new file mode 100644 index 00000000..7d3a43ed --- /dev/null +++ "b/BOJ/1000-5000353円262円210円/JY_2955.java" @@ -0,0 +1,194 @@ +package day1112; + +import java.io.*; +import java.util.*; + +public class JY_2955 { + + static final int N = 9; + static int[][] g; + static boolean[][] visited; + + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + + g = new int[N][N]; + for(int i=0; i 0) isDone = false; + } + + if(isDone) break; + + } + + printS(); + + } + public static void printG() { + for(int i=0; i 1) return false; + + // 기로즐 체크 + cnt = 0; + for(int j=0; j 1) return false; + + } + } + return true; + } + public static boolean checkBox(int n) { + // 유효한 3 * 3 찾기 + for(int i=0; i 1) return false; + if(cnt == 0 && empty == 0) return false; + } + } + return true; + } + public static boolean isValid(int n) { + visited = new boolean[N][N]; + + fillArea(n); + + return checkBox(n) && checkLine(n); + } + public static int findSpot(int n) { + // 유효한 3 * 3 찾기 + int fCnt = 0; + for(int i=0; i CrossHatching + if(cnt == 0 && empty == 1) { + visited[px][py] = true; + g[px][py] = n; + fillLine(px, py); + fCnt++; + } + } + } + return fCnt; + } + public static int crossHatching(int n) { + visited = new boolean[N][N]; + fillArea(n); + + + return findSpot(n); + } + +} From 82008e2d69972b3c04a59978eaec9506eea2c4c1 Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年11月14日 10:39:55 +0900 Subject: [PATCH 6/9] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[PG]=2015036?= =?UTF-8?q?6=20=ED=91=9C=20=EB=B3=91=ED=95=A9=5F241114?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Programmers/Level3/JY_150366.java | 136 ++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 Programmers/Level3/JY_150366.java diff --git a/Programmers/Level3/JY_150366.java b/Programmers/Level3/JY_150366.java new file mode 100644 index 00000000..8d0053f8 --- /dev/null +++ b/Programmers/Level3/JY_150366.java @@ -0,0 +1,136 @@ +import java.util.*; + +class Solution { + + static final int N = 51; + static String[][] g; + static List[] link; + static List aList; + + public String[] solution(String[] commands) { + aList = new ArrayList(); + + g = new String[N][N]; + for(int i=0; i(); + } + + for(String c: commands) { + String[] crr = c.split(" "); + + // 1) UPDATE r c value + if(crr[0].equals("UPDATE") && crr.length == 4) { + insert(Integer.parseInt(crr[1]), Integer.parseInt(crr[2]), crr[3]); + } + // 2) UPDATE value1, value2 + else if (crr[0].equals("UPDATE") && crr.length == 3) { + change(crr[1], crr[2]); + } + // 3) MERGE r1 c1 r2 c2 + else if(crr[0].equals("MERGE")) { + merge(Integer.parseInt(crr[1]), + Integer.parseInt(crr[2]), + Integer.parseInt(crr[3]), + Integer.parseInt(crr[4])); + } + // 4) UNMERGE r c + else if(crr[0].equals("UNMERGE")) { + unmerge(Integer.parseInt(crr[1]), Integer.parseInt(crr[2])); + } + // 5) PRINT r c + else if(crr[0].equals("PRINT")) { + print(Integer.parseInt(crr[1]), Integer.parseInt(crr[2])); + } + + } + + // System.out.println(aList); + String[] answer = new String[aList.size()]; + for(int i=0; i q = new LinkedList(); + boolean[][] visited = new boolean[N][N]; + + q.add(r*N + c); + visited[r][c] = true; + + while(!q.isEmpty()) { + int now = q.poll(); + int x = now / N; + int y = now % N; + g[x][y] = v; + for(int next: link[now]) { + int nx = next / N; + int ny = next % N; + if(visited[nx][ny]) continue; + + visited[nx][ny] = true; + q.add(next); + } + if(isUnmerge) link[now] = new ArrayList(); + } + } + public static void insert(int r, int c, String v) { + g[r][c] = v; + + if(link[r*N+c].isEmpty()) return; + + linking(r, c, v, false); + } + public static void change(String v1, String v2) { + for(int i=0; i Date: 2024年11月15日 09:30:45 +0900 Subject: [PATCH 7/9] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[PG]=2018118?= =?UTF-8?q?8=20=EC=9A=94=EA=B2=A9=20=EC=8B=9C=EC=8A=A4=ED=85=9C=5F241115?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Programmers/Level2/JY_181188.java | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Programmers/Level2/JY_181188.java diff --git a/Programmers/Level2/JY_181188.java b/Programmers/Level2/JY_181188.java new file mode 100644 index 00000000..c1e62a20 --- /dev/null +++ b/Programmers/Level2/JY_181188.java @@ -0,0 +1,27 @@ +import java.util.*; + +class Solution { + public int solution(int[][] targets) { + int answer = 0; + + // 시작점 기준으로 정렬 + Arrays.sort(targets, (o1, o2)->o1[0]-o2[0]); + + int N = targets.length; + int bound = 0; // 경계값 + for(int i=0; i= bound) { + answer++; + bound = e; + } else { + bound = Math.min(bound, e); // 현재 요격으로 가능한 모든 범위의 미사일을 없애야 하므로 범위가 가장 작은 미사일로 저장 + } + } + + return answer; + } +} \ No newline at end of file From 6bcb99a2ae8f5e1df1c1a9ae5f0c2accf4dd6866 Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年11月15日 10:16:59 +0900 Subject: [PATCH 8/9] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[PG]=2042884?= =?UTF-8?q?=20=EB=8B=A8=EC=86=8D=EC=B9=B4=EB=A9=94=EB=9D=BC=5F241115?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Programmers/Level3/JY_42884.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Programmers/Level3/JY_42884.java diff --git a/Programmers/Level3/JY_42884.java b/Programmers/Level3/JY_42884.java new file mode 100644 index 00000000..51f00f1d --- /dev/null +++ b/Programmers/Level3/JY_42884.java @@ -0,0 +1,19 @@ +import java.util.*; + +class Solution { + public int solution(int[][] routes) { + int answer = 0; + + Arrays.sort(routes, (o1, o2)->o1[1]-o2[1]); + + int last = -30001; + for(int [] route: routes) { + if(route[0]> last) { + answer++; + last = route[1]; + } + } + + return answer; + } +} \ No newline at end of file From 41d56e32384a9bebaa4ab673923fd9d5ff0248be Mon Sep 17 00:00:00 2001 From: yeong Date: 2024年11月15日 17:07:46 +0900 Subject: [PATCH 9/9] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=98=81:=20[SQL]=20?= =?UTF-8?q?=ED=8A=B9=EC=A0=95=20=ED=98=95=EC=A7=88=EC=9D=84=20=EA=B0=80?= =?UTF-8?q?=EC=A7=80=EB=8A=94=20=EB=8C=80=EC=9E=A5=EA=B7=A0=20=EC=B0=BE?= =?UTF-8?q?=EA=B8=B0=5F241115?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...352円267円240円_354円260円276円352円270円260円.sql" | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 "SQL/10354円243円274円354円260円250円/JY_355円212円271円354円240円225円_355円230円225円354円247円210円354円235円204円_352円260円200円354円247円200円353円212円224円_353円214円200円354円236円245円352円267円240円_354円260円276円352円270円260円.sql" diff --git "a/SQL/10354円243円274円354円260円250円/JY_355円212円271円354円240円225円_355円230円225円354円247円210円354円235円204円_352円260円200円354円247円200円353円212円224円_353円214円200円354円236円245円352円267円240円_354円260円276円352円270円260円.sql" "b/SQL/10354円243円274円354円260円250円/JY_355円212円271円354円240円225円_355円230円225円354円247円210円354円235円204円_352円260円200円354円247円200円353円212円224円_353円214円200円354円236円245円352円267円240円_354円260円276円352円270円260円.sql" new file mode 100644 index 00000000..d11d2311 --- /dev/null +++ "b/SQL/10354円243円274円354円260円250円/JY_355円212円271円354円240円225円_355円230円225円354円247円210円354円235円204円_352円260円200円354円247円200円353円212円224円_353円214円200円354円236円245円352円267円240円_354円260円276円352円270円260円.sql" @@ -0,0 +1,27 @@ +-- https://school.programmers.co.kr/learn/courses/30/lessons/301646 +-- 특정 형질을 가지는 대장균 찾기 + +-- 방법 1. 비트연산 활용 +-- 1) +SELECT COUNT(ID) AS COUNT +FROM ECOLI_DATA +WHERE (GENOTYPE & 2 != 2) AND (GENOTYPE & 1 = 1 OR GENOTYPE & 4 = 4) +-- 2) +SELECT COUNT(ID) AS COUNT +FROM ECOLI_DATA +WHERE (GENOTYPE & 2 != 2) AND (GENOTYPE & 5> 5) + +-- 방법 2. 2진수로 나타내기 +SELECT CONV(GENOTYPE, 10, 2) MOD 10 AS ONE, + (CONV(GENOTYPE, 10, 2) MOD 100) DIV 10 AS TWO, + (CONV(GENOTYPE, 10, 2) MOD 1000) DIV 100 AS THREE +FROM ECOLI_DATA + +SELECT COUNT(*) AS COUNT +FROM ECOLI_DATA E, + (SELECT CONV(GENOTYPE, 10, 2) MOD 10 AS ONE, + (CONV(GENOTYPE, 10, 2) MOD 100) DIV 10 AS TWO, + (CONV(GENOTYPE, 10, 2) MOD 1000) DIV 100 AS THREE, + ID + FROM ECOLI_DATA) G +WHERE E.ID = G.ID AND G.TWO = 0 AND (G.ONE = 1 OR G.THREE = 1); \ No newline at end of file

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