From 185f5795df274e2b726c4ae1ebbd8ae157dada0e Mon Sep 17 00:00:00 2001 From: Yujiseul <98597009+Yujiseul@users.noreply.github.com> Date: Tue, 10 May 2022 19:41:22 +0900 Subject: [PATCH 1/6] 220510_solve: P1764 --- 0510/BOJ/P1764/P1764_yu.java | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 0510/BOJ/P1764/P1764_yu.java diff --git a/0510/BOJ/P1764/P1764_yu.java b/0510/BOJ/P1764/P1764_yu.java new file mode 100644 index 0000000..c5a050f --- /dev/null +++ b/0510/BOJ/P1764/P1764_yu.java @@ -0,0 +1,45 @@ + +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Scanner; + +public class bj_1764_듣보잡 { +public static void main(String[] args) { + + Scanner sc = new Scanner(System.in); + + StringBuilder sb = new StringBuilder(); + + int n = sc.nextInt(); // 못들어본 사람 + int m = sc.nextInt(); // 못본사람 + + HashMap nosee = new HashMap<>(); + + for(int i=0; i pick = new LinkedList<>(); + + for(int i=0; i Date: Tue, 10 May 2022 19:42:20 +0900 Subject: [PATCH 2/6] 220510_solve:P1780 --- 0510/BOJ/P1780/P1780_yu.java | 58 ++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 0510/BOJ/P1780/P1780_yu.java diff --git a/0510/BOJ/P1780/P1780_yu.java b/0510/BOJ/P1780/P1780_yu.java new file mode 100644 index 0000000..daff5b9 --- /dev/null +++ b/0510/BOJ/P1780/P1780_yu.java @@ -0,0 +1,58 @@ +import java.util.Scanner; + +public class bj_1780_종이의개수 { + + static int n; + static int[][] paper; + static int[] cnt; + + public static void main(String[] args) { + + Scanner sc = new Scanner(System.in); + + n = sc.nextInt(); // N + + paper = new int[n][n]; + + cnt = new int[3]; + + for (int i = 0; i < n; i++) { + for (int j = 0; j < n; j++) { + paper[i][j] = sc.nextInt(); + } + } // 입력받기 + + divide(0, 0, n); // 분할정복!!! + + for(int i=0; i<3; i++) { + System.out.println(cnt[i]); + } + + } + + public static boolean pcheck(int row, int col, int len) { + int num = paper[row][col]; + for (int i = row; i < row + len; i++) { + for (int j = col; j < col + len; j++) { + if (paper[i][j] != num) { + return false; + } + } + } + return true; + } + + public static void divide(int row, int col, int len) { + if(pcheck(row, col, len)) { + int num = paper[row][col]; + cnt[num + 1] ++; //-1때문에 "값+1 == 인덱스" + }else { + int nextLen = len / 3; + for(int i = 0; i < 3; i++) { + for(int j = 0; j < 3; j++) { + divide(row + i*nextLen, col + j*nextLen, nextLen); + } + } + } + } +} From 9ba2532c922a8648adfb136cc82309ba3dc28734 Mon Sep 17 00:00:00 2001 From: Yujiseul <98597009+Yujiseul@users.noreply.github.com> Date: Tue, 10 May 2022 19:43:24 +0900 Subject: [PATCH 3/6] 220510_solve:P1927 --- 0510/BOJ/P1927/P1927_yu.java | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 0510/BOJ/P1927/P1927_yu.java diff --git a/0510/BOJ/P1927/P1927_yu.java b/0510/BOJ/P1927/P1927_yu.java new file mode 100644 index 0000000..a639814 --- /dev/null +++ b/0510/BOJ/P1927/P1927_yu.java @@ -0,0 +1,33 @@ +import java.util.PriorityQueue; +import java.util.Scanner; + +public class bj_1927_최소힙 { +public static void main(String[] args) { + + Scanner sc = new Scanner(System.in); + + PriorityQueue pq = new PriorityQueue<>(); + + int n = sc.nextInt(); + + StringBuilder sb = new StringBuilder(); + + for(int i = 0; i Date: Tue, 10 May 2022 19:44:14 +0900 Subject: [PATCH 4/6] 220510_solve:lv2 --- .../Lv2/\354\225\225\354\266\225_yu.java" | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 "0510/Programmers/Lv2/\354\225\225\354\266\225_yu.java" diff --git "a/0510/Programmers/Lv2/\354\225\225\354\266\225_yu.java" "b/0510/Programmers/Lv2/\354\225\225\354\266\225_yu.java" new file mode 100644 index 0000000..b798b11 --- /dev/null +++ "b/0510/Programmers/Lv2/\354\225\225\354\266\225_yu.java" @@ -0,0 +1,48 @@ +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class lv2_압축 { + public static void main(String[] args) { + + String msg = "KAKAO"; + + // + + ArrayList alp = new ArrayList<>(Arrays.asList("1", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", + "S", "T", "U", "V", "W", "X", "Y", "Z")); + + List ans = new ArrayList<>(); + + outer: for(int i=0; imsg.length()) { + ans.add(alp.indexOf(msg.substring(i, msg.length()))); + break outer; + } + } + + // 정답 배열로 출력 + int[] answer = new int[ans.size()]; + + for(int i=0; i Date: Tue, 10 May 2022 19:45:21 +0900 Subject: [PATCH 5/6] 220510_solve:lv1 --- ...3\215\224\355\225\230\352\270\260_yu.java" | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 "0510/Programmers/Lv1/\354\227\206\353\212\224\354\210\253\354\236\220\353\215\224\355\225\230\352\270\260_yu.java" diff --git "a/0510/Programmers/Lv1/\354\227\206\353\212\224\354\210\253\354\236\220\353\215\224\355\225\230\352\270\260_yu.java" "b/0510/Programmers/Lv1/\354\227\206\353\212\224\354\210\253\354\236\220\353\215\224\355\225\230\352\270\260_yu.java" new file mode 100644 index 0000000..dc057bc --- /dev/null +++ "b/0510/Programmers/Lv1/\354\227\206\353\212\224\354\210\253\354\236\220\353\215\224\355\225\230\352\270\260_yu.java" @@ -0,0 +1,26 @@ + +public class lv1_없는숫자더하기 { + public static void main(String[] args) { + + int[] numbers = {1,2,3,4,6,7,8,0}; + + // + + int answer = 0; + + for(int i=0; i<=9; i++) { + boolean flag = false; + for(int j=0; j Date: Thu, 12 May 2022 19:59:55 +0900 Subject: [PATCH 6/6] =?UTF-8?q?220512=5Fsolve:=20=EC=9D=8C=EC=96=91?= =?UTF-8?q?=EB=8D=94=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3\215\224\355\225\230\352\270\260_yu.java" | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 "0512/Programmers/Lv1/\354\235\214\354\226\221\353\215\224\355\225\230\352\270\260_yu.java" diff --git "a/0512/Programmers/Lv1/\354\235\214\354\226\221\353\215\224\355\225\230\352\270\260_yu.java" "b/0512/Programmers/Lv1/\354\235\214\354\226\221\353\215\224\355\225\230\352\270\260_yu.java" new file mode 100644 index 0000000..f583e93 --- /dev/null +++ "b/0512/Programmers/Lv1/\354\235\214\354\226\221\353\215\224\355\225\230\352\270\260_yu.java" @@ -0,0 +1,22 @@ + +public class lv1_음양더하기 { + public static void main(String[] args) { + + int[] absolutes = {4, 7, 12}; + boolean[] signs = {true,false,true}; // true: 양수 false: 음수 + int answer = 0; + + // + + for(int i=0; i