From 9961221b9c17d960a2daa7cc643d0dda8d2428d5 Mon Sep 17 00:00:00 2001 From: jaykxo Date: Thu, 11 Sep 2025 18:50:24 +0900 Subject: [PATCH 1/9] =?UTF-8?q?Solved:=2011382=20=EA=BC=AC=EB=A7=88=20?= =?UTF-8?q?=EC=A0=95=EB=AF=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...82_\352\274\254\353\247\210_\354\240\225\353\257\274.py" | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 "jaykxo/week01/11382_\352\274\254\353\247\210_\354\240\225\353\257\274.py" diff --git "a/jaykxo/week01/11382_\352\274\254\353\247\210_\354\240\225\353\257\274.py" "b/jaykxo/week01/11382_\352\274\254\353\247\210_\354\240\225\353\257\274.py" new file mode 100644 index 0000000..80b02f3 --- /dev/null +++ "b/jaykxo/week01/11382_\352\274\254\353\247\210_\354\240\225\353\257\274.py" @@ -0,0 +1,6 @@ +import sys +input = sys.stdin.readline + +A, B, C = map(int, input().split()) + +print(A + B + C) \ No newline at end of file From 319d171bbb9c8f8f9d333ac126dea54fd22bdaa8 Mon Sep 17 00:00:00 2001 From: jaykxo Date: Thu, 11 Sep 2025 18:51:12 +0900 Subject: [PATCH 2/9] =?UTF-8?q?Solved:=202438=20=EB=B3=84=20=EC=B0=8D?= =?UTF-8?q?=EA=B8=B0=20-=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2438_\353\263\204_\354\260\215\352\270\260 - 1.py" | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 "jaykxo/week01/2438_\353\263\204_\354\260\215\352\270\260 - 1.py" diff --git "a/jaykxo/week01/2438_\353\263\204_\354\260\215\352\270\260 - 1.py" "b/jaykxo/week01/2438_\353\263\204_\354\260\215\352\270\260 - 1.py" new file mode 100644 index 0000000..9b17e30 --- /dev/null +++ "b/jaykxo/week01/2438_\353\263\204_\354\260\215\352\270\260 - 1.py" @@ -0,0 +1,6 @@ +import sys +input = sys.stdin.readline +N = int(input()) + +for i in range(N): + print("*" * (i + 1)) \ No newline at end of file From e4feacf17c6c199074b46d258f313a28f57ad221 Mon Sep 17 00:00:00 2001 From: jaykxo Date: Thu, 11 Sep 2025 19:18:10 +0900 Subject: [PATCH 3/9] Solved: 10952 A+B - 5 --- jaykxo/week02/10952_A+B-5.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 jaykxo/week02/10952_A+B-5.py diff --git a/jaykxo/week02/10952_A+B-5.py b/jaykxo/week02/10952_A+B-5.py new file mode 100644 index 0000000..7fdf9f0 --- /dev/null +++ b/jaykxo/week02/10952_A+B-5.py @@ -0,0 +1,8 @@ +import sys +input = sys.stdin.readline + +while True: + a, b = map(int, input().split()) + if a == 0 and b == 0: # 종료 조건 + break + print(a + b) \ No newline at end of file From 611cd910bd3eac85711bd856db404ffc7d6331db Mon Sep 17 00:00:00 2001 From: jaykxo Date: Thu, 11 Sep 2025 19:30:27 +0900 Subject: [PATCH 4/9] =?UTF-8?q?Solved:=2010807=20=EA=B0=9C=EC=88=98=20?= =?UTF-8?q?=EC=84=B8=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...60\234\354\210\230_\354\204\270\352\270\260.py" | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 "jaykxo/week02/10807_\352\260\234\354\210\230_\354\204\270\352\270\260.py" diff --git "a/jaykxo/week02/10807_\352\260\234\354\210\230_\354\204\270\352\270\260.py" "b/jaykxo/week02/10807_\352\260\234\354\210\230_\354\204\270\352\270\260.py" new file mode 100644 index 0000000..a8999a5 --- /dev/null +++ "b/jaykxo/week02/10807_\352\260\234\354\210\230_\354\204\270\352\270\260.py" @@ -0,0 +1,14 @@ +import sys +input = sys.stdin.readline + +N = int(input()) # 숫자 개수 입력 받기 +num = list(map(int, input().split())) # 숫자 리스트 입력 받기 +v = int(input()) # 찾을 숫자 입력 받기 + +count = 0 # 찾은 숫자 개수 초기화 + +for i in range(N): + if num[i] == v : # 현재 숫자가 찾는 숫자와 같은지 확인 + count += 1 # 같으면 개수 증가 + +print(count) # 결과 출력 (찾은 숫자의 개수) \ No newline at end of file From ed139c7f3ae489f630f87446d0b5cf6096615e16 Mon Sep 17 00:00:00 2001 From: jaykxo Date: Thu, 11 Sep 2025 19:46:45 +0900 Subject: [PATCH 5/9] =?UTF-8?q?Solved:=2010798=20=EC=84=B8=EB=A1=9C?= =?UTF-8?q?=EC=9D=BD=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...70\353\241\234\354\235\275\352\270\260.py" | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 "jaykxo/week02/10798_\354\204\270\353\241\234\354\235\275\352\270\260.py" diff --git "a/jaykxo/week02/10798_\354\204\270\353\241\234\354\235\275\352\270\260.py" "b/jaykxo/week02/10798_\354\204\270\353\241\234\354\235\275\352\270\260.py" new file mode 100644 index 0000000..6a57446 --- /dev/null +++ "b/jaykxo/week02/10798_\354\204\270\353\241\234\354\235\275\352\270\260.py" @@ -0,0 +1,21 @@ +import sys +input = sys.stdin.readline + +# 1) 5줄 입력받아 리스트에 저장 +lines = [] +for _ in range(5): + line = input().strip() # 한 줄 입력받고 개행 제거 + lines.append(line) + +# 2) 가장 긴 문자열의 길이 구하기 +max_len = max(len(line) for line in lines) + +# 3) 세로로 읽기: 열을 기준으로 각 줄을 돌며 문자 추가 +result = "" +for c in range(max_len): # 열(column) 기준 + for r in range(len(lines)): # 행(row) 기준 + if c < len(lines[r]): # 해당 줄에 문자가 존재하면 + result += lines[r][c] + +# 4) 결과 문자열 출력 +print(result) \ No newline at end of file From 045101bd934cce08b3fc175fc281386291ca91b4 Mon Sep 17 00:00:00 2001 From: jaykxo Date: Thu, 18 Sep 2025 17:33:57 +0900 Subject: [PATCH 6/9] =?UTF-8?q?Solved:=202750=20=EC=88=98=20=EC=A0=95?= =?UTF-8?q?=EB=A0=AC=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\240\225\353\240\254\355\225\230\352\270\260.py" | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 "jaykxo/week03/2750_\354\210\230_\354\240\225\353\240\254\355\225\230\352\270\260.py" diff --git "a/jaykxo/week03/2750_\354\210\230_\354\240\225\353\240\254\355\225\230\352\270\260.py" "b/jaykxo/week03/2750_\354\210\230_\354\240\225\353\240\254\355\225\230\352\270\260.py" new file mode 100644 index 0000000..fe39357 --- /dev/null +++ "b/jaykxo/week03/2750_\354\210\230_\354\240\225\353\240\254\355\225\230\352\270\260.py" @@ -0,0 +1,13 @@ +# 2750 수 정렬하기 +# 메모리: 32412 KB, 시간: 40 ms + +import sys +input = sys.stdin.readline + +N = int(input()) +A = [int(input()) for _ in range(N)] + +A.sort() # 리스트 오름차순 정렬 + +for num in A: + print(num) \ No newline at end of file From 8824e36cc0894204c1257033d8bc8b6e55057661 Mon Sep 17 00:00:00 2001 From: jaykxo Date: Thu, 18 Sep 2025 17:36:52 +0900 Subject: [PATCH 7/9] =?UTF-8?q?Solved:=201181=20=EB=8B=A8=EC=96=B4=20?= =?UTF-8?q?=EC=A0=95=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\250\354\226\264_\354\240\225\353\240\254.py" | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 "jaykxo/week03/1181_\353\213\250\354\226\264_\354\240\225\353\240\254.py" diff --git "a/jaykxo/week03/1181_\353\213\250\354\226\264_\354\240\225\353\240\254.py" "b/jaykxo/week03/1181_\353\213\250\354\226\264_\354\240\225\353\240\254.py" new file mode 100644 index 0000000..eb00c24 --- /dev/null +++ "b/jaykxo/week03/1181_\353\213\250\354\226\264_\354\240\225\353\240\254.py" @@ -0,0 +1,16 @@ +# 1181 단어 정렬 +# 메모리: 37692 KB, 시간: 80 ms + +import sys +input = sys.stdin.readline + +N = int(input()) + +# 단어들을 입력받아 리스트에 저장 +words = [input().strip() for _ in range(N)] + +# 중복 제거 후 길이 → 사전순으로 정렬 +words = sorted(set(words), key=lambda x: (len(x), x)) + +for word in words: + print(word) \ No newline at end of file From eff07d7ddd92eabd0cb44cd1ed6ad4d1dafab661 Mon Sep 17 00:00:00 2001 From: jaykxo Date: Thu, 18 Sep 2025 17:46:20 +0900 Subject: [PATCH 8/9] =?UTF-8?q?Solved:=201920=20=EC=88=98=20=EC=B0=BE?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._\354\210\230_\354\260\276\352\270\260.py" | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 "jaykxo/week03/1920_\354\210\230_\354\260\276\352\270\260.py" diff --git "a/jaykxo/week03/1920_\354\210\230_\354\260\276\352\270\260.py" "b/jaykxo/week03/1920_\354\210\230_\354\260\276\352\270\260.py" new file mode 100644 index 0000000..c5a0906 --- /dev/null +++ "b/jaykxo/week03/1920_\354\210\230_\354\260\276\352\270\260.py" @@ -0,0 +1,60 @@ +# 1920 수 찾기 +# 메모리: 50412 KB, 시간: 504 ms + +import sys +input = sys.stdin.readline +from typing import Any, Sequence + +N = int(input()) +A = list(map(int, input().split())) +A.sort() # 이분 탐색을 위해 반드시 정렬 필요 +M = int(input()) +K = list(map(int, input().split())) + +def bin_search(A: Sequence, key: Any): + pl = 0 + pr = len(A) - 1 # 탐색 범위 오른쪽 끝 (리스트 마지막 인덱스) + + while pl <= pr: + pc = (pl + pr) // 2 # 현재 탐색 구간의 중간 인덱스 + + if A[pc] == key: + print("1") + return pc # 찾으면 인덱스 반환 (실제 문제에서는 출력만 필요) + + elif A[pc] < key: + pl = pc + 1 # 찾는 값이 더 크면 오른쪽 반으로 탐색 범위 좁힘 + else: + pr = pc - 1 # 찾는 값이 더 작으면 왼쪽 반으로 탐색 범위 좁힘 + + print("0") # 끝까지 못 찾으면 0 출력 + +# 찾을 숫자들을 하나씩 이분 탐색 실행 +for key in K: + bin_search(A, key) + + +############ 번외 ############ +# node.js 제출 버전 +# 메모리: 39068 KB, 시간: 324 ms + +# const fs = require("fs"); +# const input = fs.readFileSync(0).toString().trim().split("\n"); + +# const N = Number(input[0]); +# const A = input[1].split(" ").map(Number).sort((a, b) => a - b); +# const M = Number(input[2]); +# const targets = input[3].split(" ").map(Number); + +# function binarySearch(arr, target) { +# let start = 0, end = arr.length - 1; +# while (start <= end) { +# let mid = Math.floor((start + end) / 2); +# if (arr[mid] === target) return 1; +# if (arr[mid] < target) start = mid + 1; +# else end = mid - 1; +# } +# return 0; +# } + +# console.log(targets.map(t => binarySearch(A, t)).join("\n")); \ No newline at end of file From 2112907b407026cb864f4b0627ae3a5b4deea2fa Mon Sep 17 00:00:00 2001 From: jaykxo Date: Thu, 18 Sep 2025 18:24:32 +0900 Subject: [PATCH 9/9] =?UTF-8?q?Solved:=2010816=20=EC=88=AB=EC=9E=90=20?= =?UTF-8?q?=EC=B9=B4=EB=93=9C=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...354\236\220_\354\271\264\353\223\234_2.py" | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 "jaykxo/week03/10816_\354\210\253\354\236\220_\354\271\264\353\223\234_2.py" diff --git "a/jaykxo/week03/10816_\354\210\253\354\236\220_\354\271\264\353\223\234_2.py" "b/jaykxo/week03/10816_\354\210\253\354\236\220_\354\271\264\353\223\234_2.py" new file mode 100644 index 0000000..b5f8222 --- /dev/null +++ "b/jaykxo/week03/10816_\354\210\253\354\236\220_\354\271\264\353\223\234_2.py" @@ -0,0 +1,21 @@ +# 10816 숫자 카드 2 +# 메모리: 117520 KB, 시간: 1384 ms + + +import bisect # 이분 탐색을 내장 함수로 제공 +import sys +input = sys.stdin.readline + +N = int(input()) +A = list(map(int, input().split())) +A.sort() # 이분 탐색을 위한 정렬 +M = int(input()) +K = list(map(int, input().split())) + +# bisect_left, bisect_right 내장 함수를 이용하여 구간(개수) 계산 +for t in K: + left = bisect.bisect_left(A, t) # t가 처음 등장하는 인덱스 + right = bisect.bisect_right(A, t) # t가 마지막으로 끝난 뒤 인덱스 + count = (right - left) # 두 위치 차이가 t의 개수 + + print(count, end=" ") # 개수를 공백으로 구분하여 출력 \ No newline at end of file