From 71f9b5239d46de18a9709c49fcd28ae274fb54fd Mon Sep 17 00:00:00 2001 From: ye0ngeun Date: Tue, 14 Oct 2025 17:47:30 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[PGS]=20=EC=9D=B4=EC=98=81=EC=9D=80=20/=20?= =?UTF-8?q?=EC=98=88=EC=82=B0=20/=2010?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pgs_12982.py" | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 "yeongeun/[week2] \352\267\270\353\246\254\353\224\224/pgs_12982.py" diff --git "a/yeongeun/[week2] \352\267\270\353\246\254\353\224\224/pgs_12982.py" "b/yeongeun/[week2] \352\267\270\353\246\254\353\224\224/pgs_12982.py" new file mode 100644 index 0000000..756a6c8 --- /dev/null +++ "b/yeongeun/[week2] \352\267\270\353\246\254\353\224\224/pgs_12982.py" @@ -0,0 +1,13 @@ +# 예산 + +def solution(d, budget): + d.sort() + total = 0 + count = 0 + for cost in d: + if total + cost <= budget: + total += cost + count += 1 + else: + break + return count \ No newline at end of file From bfbaaadf8b0d8fbb7c31b717f83eb204f1e038c6 Mon Sep 17 00:00:00 2001 From: ye0ngeun Date: Tue, 14 Oct 2025 17:53:47 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[PGS]=20=EC=9D=B4=EC=98=81=EC=9D=80=20/=202?= =?UTF-8?q?=EA=B0=9C=20=EC=9D=B4=ED=95=98=EB=A1=9C=20=EB=8B=A4=EB=A5=B8=20?= =?UTF-8?q?=EB=B9=84=ED=8A=B8=20/=2030?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pgs_77885.py" | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 "yeongeun/[week2] \352\267\270\353\246\254\353\224\224/pgs_77885.py" diff --git "a/yeongeun/[week2] \352\267\270\353\246\254\353\224\224/pgs_77885.py" "b/yeongeun/[week2] \352\267\270\353\246\254\353\224\224/pgs_77885.py" new file mode 100644 index 0000000..a4a3d83 --- /dev/null +++ "b/yeongeun/[week2] \352\267\270\353\246\254\353\224\224/pgs_77885.py" @@ -0,0 +1,15 @@ +# 2개 이하로 다른 비트 + +def solution(numbers): + answer = [] + for x in numbers: + if x % 2 == 0: + answer.append(x + 1) + else: + bits = list('0' + bin(x)[2:]) + idx = ''.join(bits).rfind('0') + bits[idx] = '1' + bits[idx + 1] = '0' + min_num = int(''.join(bits), 2) + answer.append(min_num) + return answer \ No newline at end of file From 80f2215c82f8b3a57353d877cf0fb00d4b078541 Mon Sep 17 00:00:00 2001 From: ye0ngeun Date: Tue, 14 Oct 2025 19:36:37 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[BOJ]=20=EC=9D=B4=EC=98=81=EC=9D=80=20/=20?= =?UTF-8?q?=EC=A3=BC=EC=9C=A0=EC=86=8C=20/=2040?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../boj_13305.py" | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 "yeongeun/[week2] \352\267\270\353\246\254\353\224\224/boj_13305.py" diff --git "a/yeongeun/[week2] \352\267\270\353\246\254\353\224\224/boj_13305.py" "b/yeongeun/[week2] \352\267\270\353\246\254\353\224\224/boj_13305.py" new file mode 100644 index 0000000..2dcd4fb --- /dev/null +++ "b/yeongeun/[week2] \352\267\270\353\246\254\353\224\224/boj_13305.py" @@ -0,0 +1,16 @@ +import sys +input = sys.stdin.readline + +N = int(input()) +distance = list(map(int, input().split())) +price = list(map(int, input().split())) + +total = 0 +min_price = price[0] + +for i in range(N - 1): + if price[i] < min_price: + min_price = price[i] + total += min_price * distance[i] + +print(total)