From 65bdc403d6ca004f5652242685160315d8e550e5 Mon Sep 17 00:00:00 2001 From: Yejin-Ha Date: Thu, 23 Jun 2022 11:44:15 +0900 Subject: [PATCH 1/3] =?UTF-8?q?7=EC=A3=BC=EC=B0=A8=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=92=80=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BAEKJOON/week07/yejin/Q1110.java | 32 ++++++++++++++++++++++ BAEKJOON/week07/yejin/Q1312.java | 47 ++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 BAEKJOON/week07/yejin/Q1110.java create mode 100644 BAEKJOON/week07/yejin/Q1312.java diff --git a/BAEKJOON/week07/yejin/Q1110.java b/BAEKJOON/week07/yejin/Q1110.java new file mode 100644 index 0000000..102f6b4 --- /dev/null +++ b/BAEKJOON/week07/yejin/Q1110.java @@ -0,0 +1,32 @@ +import java.util.Scanner; + +/** + * Q1110 + * + * #### 제출 + * 틀렸습니다. + * + * -> 파이썬으로 하면 성공인데 어이없음 + */ + +public class Q1110 { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int n = sc.nextInt(); + sc.close(); + int tmpN = n; + + int cnt = 0; + while (true) { + int a = tmpN / 10; + int b = tmpN % 10; + int tmp = b * 10 + ((a+b)%10); + cnt++; + System.out.println(tmp + " " +cnt); + if (tmp == n) + break; + tmpN = tmp; + } + System.out.println(cnt); + } +} \ No newline at end of file diff --git a/BAEKJOON/week07/yejin/Q1312.java b/BAEKJOON/week07/yejin/Q1312.java new file mode 100644 index 0000000..1099be4 --- /dev/null +++ b/BAEKJOON/week07/yejin/Q1312.java @@ -0,0 +1,47 @@ +import java.io.BufferedInputStream; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.Scanner; +import java.util.StringTokenizer; + +/** + * Q1312 + * + * #### 제출 + * 실패 + */ + +public class Q1312 { + // bufferedReader 사용 + + // public static void main(String[] args) throws Exception { + // BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + // StringTokenizer st = new StringTokenizer(br.readLine()); + // br.close(); + + // int[] arr = new int[3]; + // int i = 0; + // while(st.hasMoreTokens()){ + // arr[i++] = Integer.parseInt(st.nextToken()); + // } + // double result = (double) arr[0] / arr[1]; + // int multi = 1; + // for (int j = 0; j < arr[2]; j++){ + // multi *= 10; + // } + // System.out.println((int)(result * multi )% 10); + // } + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + Double a = sc.nextDouble(); + Double b = sc.nextDouble(); + int n = sc.nextInt(); + + String result = Double.toString(a / b); + System.out.println(result); + int c = result.charAt(n + 1) - '0'; + System.out.println(c); + System.out.println(result.charAt(n + 1) - '0'); + } +} \ No newline at end of file From 4ba993db51b03c6ab6bf9d81dd5fca625335527d Mon Sep 17 00:00:00 2001 From: Yejin-Ha Date: Mon, 27 Jun 2022 14:59:13 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=EC=95=8C=EA=B3=A0=EB=A6=AC=EC=A6=98=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c7ba05..48f8b58 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ |4주차|백준] 덱(10866)
백준] 모음의 수(1264)|https://www.acmicpc.net/problem/10866
https://www.acmicpc.net/problem/1264| |5주차|백준] 슈퍼마리오(2851)
백준] 2루수 이름이 뭐야(17350)|https://www.acmicpc.net/problem/2851
https://www.acmicpc.net/problem/17350| |6주차|백준] 평균점수(10039)
백준] 덱(10866) [re]|https://www.acmicpc.net/problem/10039
https://www.acmicpc.net/problem/10866| +|7주차|백준] 소수(1312)
백준] 더하기 사이클(1110) [re]|https://www.acmicpc.net/problem/1312
https://www.acmicpc.net/problem/1110| @@ -42,6 +43,10 @@
## 알고리즘 정리 -- ### 자료구조 +- **자료구조** - [Deque](https://puddle-horse-c8c.notion.site/Deque-5717b3f2251840b18a92620edadebf62) --> [관련 문제 : 백준 10866번](https://www.acmicpc.net/problem/10866) +- **수학** - [에라토스테네스의 체](https://puddle-horse-c8c.notion.site/9e76cf12e0604350a81222705138631d) --> [관련 문제 : 백준 1929번](https://www.acmicpc.net/problem/1929) +- **그리디 알고리즘** + - [탐욕 알고리즘](https://puddle-horse-c8c.notion.site/d878145382924792a2cd6216236cf0c6) --> [관련 문제 : 백준 2839번](https://www.acmicpc.net/problem/2839) + From 0e2ec842a07618a58e3aefd2af1c6be2c13e6ae3 Mon Sep 17 00:00:00 2001 From: Yejin-Ha Date: Mon, 27 Jun 2022 15:36:09 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EB=B0=B1=EC=A4=80]=20=EC=84=A4=ED=83=95=20?= =?UTF-8?q?=EB=B0=B0=EB=8B=AC=20=ED=92=80=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BAEKJOON/week07/yejin/Q2839.java | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 BAEKJOON/week07/yejin/Q2839.java diff --git a/BAEKJOON/week07/yejin/Q2839.java b/BAEKJOON/week07/yejin/Q2839.java new file mode 100644 index 0000000..29f4105 --- /dev/null +++ b/BAEKJOON/week07/yejin/Q2839.java @@ -0,0 +1,32 @@ +import java.util.Scanner; + +/* + * 3, 5kg 봉지를 갖고 있음 + * + * #### 제출 + * 성공 + */ +public class Q2839 { + public static void main(String[] args) { + Scanner scan = new Scanner(System.in); + int n = scan.nextInt(); + int result = 0; + scan.close(); + + while (true) { + if (n % 5 == 0) { + result += n / 5; + System.out.println(result); + break; + } else { + n -= 3; + result++; + } + + if(n < 0) { + System.out.println(-1); + break; + } + } + } +}