From 58df0fe1ec603971db8a887caf596fe722130813 Mon Sep 17 00:00:00 2001 From: ProblmZro Date: Wed, 15 Oct 2025 20:46:16 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=EB=B0=B1=EC=A4=80=20=EB=AC=B8=ED=92=801?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- baekjoon/2293.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 baekjoon/2293.py diff --git a/baekjoon/2293.py b/baekjoon/2293.py new file mode 100644 index 0000000..6e9de4d --- /dev/null +++ b/baekjoon/2293.py @@ -0,0 +1,18 @@ +# 동전을 하나씩 넣으며 dp[i]의 경우 i를 만드는 경우의 수 계산 +# 예시 : i=4이고, 동전 2 넣을 때 +# dp[4] = dp[4] + dp[4-2] +# 1로 4 만드는 경우 (dp[4]) + 2 만든 거에 2 넣는 경우의 수 (dp[4-2]) + +n, k = map(int, input().split()) +coins = [] +for _ in range(n): + coins.append(int(input())) + +dp = [0] * (k+1) +dp[0] = 1 + +for coin in coins: + for i in range(coin, k+1): + dp[i] += dp[i-coin] + +print(dp[-1]) \ No newline at end of file From 55bb1c78472a2dc1246ef9dcf4d5058738c7573a Mon Sep 17 00:00:00 2001 From: ProblmZro Date: Wed, 15 Oct 2025 21:41:05 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=EB=B0=B1=EC=A4=80=20=EB=AC=B8=ED=92=802?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- baekjoon/1520.py | 21 +++++++++++++++++++++ baekjoon/29751.py | 3 +++ 2 files changed, 24 insertions(+) create mode 100644 baekjoon/1520.py create mode 100644 baekjoon/29751.py diff --git a/baekjoon/1520.py b/baekjoon/1520.py new file mode 100644 index 0000000..91ae66f --- /dev/null +++ b/baekjoon/1520.py @@ -0,0 +1,21 @@ +M, N = map(int, input().split()) +graph = [] +for _ in range(M): + graph.append(list(map(int, input().split()))) +dp = [[-1]*N for _ in range(M)] +dx = [0, 1, 0, -1] +dy = [1, 0 , -1, 0] + +def sol(x, y): + if x==M-1 and y == N-1: + return 1 + if dp[x][y] == -1: + dp[x][y] = 0 # 방문 처리 + for i in range(4): + nx, ny = x+dx[i], y+dy[i] + if 0<=nx Date: Wed, 29 Oct 2025 11:25:37 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=EB=B0=B1=EC=A4=80=20=EB=AC=B8=ED=92=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- baekjoon/1520.py | 4 ++++ baekjoon/2133.py | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 baekjoon/2133.py diff --git a/baekjoon/1520.py b/baekjoon/1520.py index 91ae66f..78c9b74 100644 --- a/baekjoon/1520.py +++ b/baekjoon/1520.py @@ -1,3 +1,7 @@ +import sys +sys.setrecursionlimit(10 ** 8) +input = sys.stdin.readline + M, N = map(int, input().split()) graph = [] for _ in range(M): diff --git a/baekjoon/2133.py b/baekjoon/2133.py new file mode 100644 index 0000000..27afdbf --- /dev/null +++ b/baekjoon/2133.py @@ -0,0 +1,8 @@ +N = int(input()) +dp = [0] * 31 +dp[2] = 3 +for i in range(4, N+1): + if i%2 == 0: + dp[i] = dp[i-2]*3 + sum(dp[:i-2])*2 + 2 + +print(dp[N]) \ No newline at end of file From 69ed19494910f7e991ddd89dd30c7fa272635d68 Mon Sep 17 00:00:00 2001 From: ProblmZro Date: Wed, 5 Nov 2025 16:33:02 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=EB=B0=B1=EC=A4=80=201253=20=EB=AC=B8?= =?UTF-8?q?=ED=92=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- baekjoon/1253.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 baekjoon/1253.py diff --git a/baekjoon/1253.py b/baekjoon/1253.py new file mode 100644 index 0000000..1499a27 --- /dev/null +++ b/baekjoon/1253.py @@ -0,0 +1,23 @@ +N = int(input()) +A = list(map(int, input().split())) +A.sort() + +res = 0 +for i in range(N): + target = A[i] + start, end = 0, len(A)-1 + while start < end: + if A[start] + A[end] == target: + if start == i: + start += 1 + elif end == i: + end -= 1 + else: + res += 1 + break + elif A[start] + A[end] > target: + end -= 1 + elif A[start] + A[end] < target: + start += 1 + +print(res) \ No newline at end of file