From c02235fe135c678d57a82a0f4578f9e9efd00acd Mon Sep 17 00:00:00 2001 From: YoonYn9915 Date: Sat, 3 May 2025 21:44:53 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[BOJ]=20=EC=97=B0=EC=86=8D=ED=95=A9=20/=20?= =?UTF-8?q?=EC=8B=A4=EB=B2=84=202=20/=2060=EB=B6=84=20=ED=9E=8C=ED=8A=B8?= =?UTF-8?q?=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acmicpc.net/problem/1912 --- ...244\200]-#1912-\354\227\260\354\206\215\355\225\251.py" | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 "YoonYn9915/dp/2025-05-03-[\353\260\261\354\244\200]-#1912-\354\227\260\354\206\215\355\225\251.py" diff --git "a/YoonYn9915/dp/2025-05-03-[\353\260\261\354\244\200]-#1912-\354\227\260\354\206\215\355\225\251.py" "b/YoonYn9915/dp/2025-05-03-[\353\260\261\354\244\200]-#1912-\354\227\260\354\206\215\355\225\251.py" new file mode 100644 index 0000000..4b443ef --- /dev/null +++ "b/YoonYn9915/dp/2025-05-03-[\353\260\261\354\244\200]-#1912-\354\227\260\354\206\215\355\225\251.py" @@ -0,0 +1,7 @@ +n = int(input()) +arr = list(map(int, input().split())) +dp = [0] * n +dp[0] = arr[0] +for i in range(1, n): + dp[i] = max(arr[i], dp[i-1]+arr[i]) +print(max(dp)) \ No newline at end of file From d5d3e3fcd9314bf2b6b1f618b40a2879a86afcb6 Mon Sep 17 00:00:00 2001 From: YoonYn9915 Date: Sat, 3 May 2025 21:46:16 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[BOJ]=20RGB=EA=B1=B0=EB=A6=AC=20/=20?= =?UTF-8?q?=EC=8B=A4=EB=B2=84=201=20/=2040=EB=B6=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acmicpc.net/problem/1149 --- ...44\200]-#1149-RGB\352\261\260\353\246\254.py" | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 "YoonYn9915/dp/2025-05-03-[\353\260\261\354\244\200]-#1149-RGB\352\261\260\353\246\254.py" diff --git "a/YoonYn9915/dp/2025-05-03-[\353\260\261\354\244\200]-#1149-RGB\352\261\260\353\246\254.py" "b/YoonYn9915/dp/2025-05-03-[\353\260\261\354\244\200]-#1149-RGB\352\261\260\353\246\254.py" new file mode 100644 index 0000000..9f9ddbd --- /dev/null +++ "b/YoonYn9915/dp/2025-05-03-[\353\260\261\354\244\200]-#1149-RGB\352\261\260\353\246\254.py" @@ -0,0 +1,16 @@ +n = int(input()) + +cost = [] +minCost = -int(1e9) +dp = [[0]*3 for _ in range(n)] +for i in range(n): + cost.append(list(map(int, input().split()))) + +dp[0][0], dp[0][1], dp[0][2] = cost[0][0], cost[0][1], cost[0][2] + +for i in range(1, n): + dp[i][0] = min(dp[i-1][1] + cost[i][0], dp[i-1][2] + cost[i][0]) + dp[i][1] = min(dp[i-1][0] + cost[i][1], dp[i-1][2] + cost[i][1]) + dp[i][2] = min(dp[i-1][0] + cost[i][2], dp[i-1][1] + cost[i][2]) + +print(min(dp[n-1][0], dp[n-1][1], dp[n-1][2])) \ No newline at end of file From 73c3d3f5245cac0c482cef47e10b449f4ed6a191 Mon Sep 17 00:00:00 2001 From: YoonYn9915 Date: Sat, 3 May 2025 21:56:36 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[BOJ]=20=EB=9E=9C=EC=84=A0=20=EC=9E=90?= =?UTF-8?q?=EB=A5=B4=EA=B8=B0=20/=20=EC=8B=A4=EB=B2=84=202=20/=2050?= =?UTF-8?q?=EB=B6=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acmicpc.net/problem/1654 --- ...0 \354\236\220\353\245\264\352\270\260.py" | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 "YoonYn9915/binary search/2025-05-03-[\353\260\261\354\244\200]-#1654-\353\236\234\354\204\240 \354\236\220\353\245\264\352\270\260.py" diff --git "a/YoonYn9915/binary search/2025-05-03-[\353\260\261\354\244\200]-#1654-\353\236\234\354\204\240 \354\236\220\353\245\264\352\270\260.py" "b/YoonYn9915/binary search/2025-05-03-[\353\260\261\354\244\200]-#1654-\353\236\234\354\204\240 \354\236\220\353\245\264\352\270\260.py" new file mode 100644 index 0000000..a463ce0 --- /dev/null +++ "b/YoonYn9915/binary search/2025-05-03-[\353\260\261\354\244\200]-#1654-\353\236\234\354\204\240 \354\236\220\353\245\264\352\270\260.py" @@ -0,0 +1,19 @@ +N, K = map(int, input().split()) +lis = [] +for _ in range(N): + lis.append(int(input())) + +s = 1 +e = max(lis) + +while s <= e: + mid = (s + e) // 2 + LAN = 0 + for i in lis: + LAN += i // mid + if LAN >= K: + s = mid + 1 + else: + e = mid - 1 + +print(e)