From 1c8586a463a2e0732241e40f5e5ed6008dcda4fb Mon Sep 17 00:00:00 2001 From: INSEA-99 Date: Sun, 7 Sep 2025 01:24:33 +0900 Subject: [PATCH 1/4] =?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" | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 "INSEA-99/week02/10798_\354\204\270\353\241\234\354\235\275\352\270\260.py" diff --git "a/INSEA-99/week02/10798_\354\204\270\353\241\234\354\235\275\352\270\260.py" "b/INSEA-99/week02/10798_\354\204\270\353\241\234\354\235\275\352\270\260.py" new file mode 100644 index 0000000..585d44f --- /dev/null +++ "b/INSEA-99/week02/10798_\354\204\270\353\241\234\354\235\275\352\270\260.py" @@ -0,0 +1,30 @@ +import sys +from itertools import zip_longest +input = sys.stdin.readline + +lines = [input().rstrip() for _ in range(5)] +vertical_chars = [''.join(filter(None, chars)) for chars in zip_longest(*lines)] +print(''.join(vertical_chars)) + + +# - filter(function, iterable) +# iterable의 각 요소를 차례로 function에 넣고 반환값이 True면 사용, False면 제거 +# function 대산 None을 넣는 경우 None을 제거해줌 + +# - zip +# 여러 iterable(리스트, 문자열 등) 을 병렬로 묶어서 튜플을 만들어줌 +# 가장 짧은 iterable 길이에 맞춰 묶음이 생성됨 +# 예시) +# a = [1, 2, 3] +# b = ['x', 'y'] +# zip(a, b) -> [(1, 'x'), (2, 'y')] +# +# - zip_longest +# zip과 기능이 동일하지만 가장 긴 iterable 길이에 맞추고 그것보다 짧은 iterable은 None으로 채움(None 대신 다른 값으로 설정 가능. 인자에 fillvalue=?) + +# - * (언패킹) +# 리스트, 튜플, 문자열 등 iterable을 개별 요소로 풀어서 함수 인자나 다른 자료구조에 전달 +# ex) +# lst1 = [1, 2] +# lst2 = [3, 4] +# combined = [*lst1, *lst2] # [1, 2, 3, 4] From e7f7fa741aaa8592d0857f6e6c8c3bfb099747d8 Mon Sep 17 00:00:00 2001 From: INSEA-99 Date: Sun, 7 Sep 2025 01:24:57 +0900 Subject: [PATCH 2/4] =?UTF-8?q?10807=20=EA=B0=9C=EC=88=98=20=EC=84=B8?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\234\354\210\230_\354\204\270\352\270\260.py" | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 "INSEA-99/week02/10807_\352\260\234\354\210\230_\354\204\270\352\270\260.py" diff --git "a/INSEA-99/week02/10807_\352\260\234\354\210\230_\354\204\270\352\270\260.py" "b/INSEA-99/week02/10807_\352\260\234\354\210\230_\354\204\270\352\270\260.py" new file mode 100644 index 0000000..1536556 --- /dev/null +++ "b/INSEA-99/week02/10807_\352\260\234\354\210\230_\354\204\270\352\270\260.py" @@ -0,0 +1,16 @@ +import sys +input = sys.stdin.readline + +ans = 0 + +# 입력 +input() # 다른 언어는 리스트 입력 받을 때 몇개인지 정보가 필요한 경우가 있는데, 파이썬은 필요없어서 그냥 받기만 하고 사용 안함 +nums = map(int, input().split()) +v = int(input()) + +# 풀이 +for n in nums: + if(n==v): ans+=1 + +# 출력 +print(ans) From 823679a9647329d02a2833d53923aebc9c41b325 Mon Sep 17 00:00:00 2001 From: INSEA-99 Date: Sun, 7 Sep 2025 01:25:39 +0900 Subject: [PATCH 3/4] Solved: 10952 A+B - 5 --- INSEA-99/week02/10952_A+B-5.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 INSEA-99/week02/10952_A+B-5.py diff --git a/INSEA-99/week02/10952_A+B-5.py b/INSEA-99/week02/10952_A+B-5.py new file mode 100644 index 0000000..7d02847 --- /dev/null +++ b/INSEA-99/week02/10952_A+B-5.py @@ -0,0 +1,16 @@ +import sys +input = sys.stdin.readline + +while(True): + a, b = map(int, input().split()) + if(a==0 and b==0): + break + print(a+b) + +# [입력 받는 로직 설명] +# a, b = map(int, input().split()) +# 예시) 만약 "1 1" 입력이 들어왔다면 +# 1. input()을 통해 "1 1"을 가져옴 +# 2. input().split()를 통해 공백을 기준으로 쪼갠 리스트를 얻음["1", "1"] (쪼개는 기준 split에 인자 줘서 바꿀 수 있음) +# 3. map을 통해 list의 원소마다 int를 적용시켜줌 -> [1, 1] +# 4. a, b = [1, 1]를 하면 파이썬에서 제공하는 시퀀스 언패킹 기능으로 a=1, b=1이 할당됨 \ No newline at end of file From bc38d719b1899db11c7d64d77ce725da5afd8e94 Mon Sep 17 00:00:00 2001 From: INSEA-99 Date: Sun, 7 Sep 2025 01:26:21 +0900 Subject: [PATCH 4/4] =?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 --- .../10807_\352\260\234\354\210\230_\354\204\270\352\270\260.py" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/INSEA-99/week02/10807_\352\260\234\354\210\230_\354\204\270\352\270\260.py" "b/INSEA-99/week02/10807_\352\260\234\354\210\230_\354\204\270\352\270\260.py" index 1536556..e90bbdf 100644 --- "a/INSEA-99/week02/10807_\352\260\234\354\210\230_\354\204\270\352\270\260.py" +++ "b/INSEA-99/week02/10807_\352\260\234\354\210\230_\354\204\270\352\270\260.py" @@ -13,4 +13,4 @@ if(n==v): ans+=1 # 출력 -print(ans) +print(ans) \ No newline at end of file