From 67625773eefa9c394c1efa5d9d82e7e2e501ddc5 Mon Sep 17 00:00:00 2001 From: sh0723 Date: Thu, 16 Jul 2026 13:56:14 +0900 Subject: [PATCH] =?UTF-8?q?2343=20:=20=EA=B8=B0=ED=83=80=20=EB=A0=88?= =?UTF-8?q?=EC=8A=A8=20solve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/week6/BOJ2343/BOJ2343_V1.cpp | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/week6/BOJ2343/BOJ2343_V1.cpp diff --git a/src/week6/BOJ2343/BOJ2343_V1.cpp b/src/week6/BOJ2343/BOJ2343_V1.cpp new file mode 100644 index 0000000..6a1b0bb --- /dev/null +++ b/src/week6/BOJ2343/BOJ2343_V1.cpp @@ -0,0 +1,44 @@ +#include +using namespace std; +int N,M; +int inp[100000]; +int main() { + + ios_base::sync_with_stdio(false); + cin.tie(nullptr); + cout.tie(nullptr); + + cin >> N >> M; + long long high=0, low=0; + for (int i=0; i> inp[i]; + if (inp[i] > low) + low = inp[i]; + high += inp[i]; + } + low--; + while(low + 1 < high) { + long long mid = (high + low) / 2; + long long temp = 0; + int cnt = 1; + for (int i=0; i