From 8ad4edac049ef031fc3a2f4da9c7394c2559a769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=88=98=ED=98=84?= Date: Fri, 26 Jul 2024 01:06:37 +0900 Subject: [PATCH] =?UTF-8?q?2024-07-24=20=EB=82=98=EB=AC=B4=20=EC=9E=90?= =?UTF-8?q?=EB=A5=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 함수명 수정 --- .../12-suhyun113.cpp" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/suhyun113/\354\235\264\353\266\204 \355\203\220\354\203\211/12-suhyun113.cpp" "b/suhyun113/\354\235\264\353\266\204 \355\203\220\354\203\211/12-suhyun113.cpp" index 764f1bd..08a08f5 100644 --- "a/suhyun113/\354\235\264\353\266\204 \355\203\220\354\203\211/12-suhyun113.cpp" +++ "b/suhyun113/\354\235\264\353\266\204 \355\203\220\354\203\211/12-suhyun113.cpp" @@ -6,7 +6,7 @@ using namespace std; // 절단기에 지정한 나무의 높이 H로 나무를 자름 // H보다 크면 자르기(작으면, 값이 0 또는 음수로 나옴) -bool canCut(vector& trees, int H, int M) { +bool can_cut(vector& trees, int H, int M) { long long total = 0; // 자른 나무들의 총 합 for (int tree : trees) { if (tree > H) { @@ -23,7 +23,7 @@ int binary_search(vector& trees, int M) { while (lo + 1 < hi) { int mid = (lo + hi) / 2; // 중앙값 저장 - if (canCut(trees, mid, M)) { // 절단기 높이 변경 + if (can_cut(trees, mid, M)) { // 절단기 높이 변경 lo = mid; // 현재의 절단기 높이를 가능한 최소 높이로 저장(중앙값 더 커짐) } else {