diff --git a/oesnuj/README.md b/oesnuj/README.md index 2513849..1052526 100644 --- a/oesnuj/README.md +++ b/oesnuj/README.md @@ -6,10 +6,11 @@ | 2차시 | 2024.03.29 | 연결리스트 | [에디터](https://www.acmicpc.net/problem/1406) | [#8](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/8) | | 3차시 | 2024.04.02 | 덱 | [카드 놓기](https://www.acmicpc.net/problem/18115) | [#11](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/11) | | 4차시 | 2024.04.06 | 스택 | [옥상 정원 꾸미기](https://www.acmicpc.net/problem/6198) | [#14](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/14) | -| 5차시 | 2024.04.13 | 이분탐색 | [듣보잡](https://www.acmicpc.net/problem/1764) | [#20](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/20) | -| 6차시 | 2024.05.06 | 기하학 | [정사각형](https://www.acmicpc.net/problem/1485) | [#22](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/22) | +| 5차시 | 2024.04.13 | 이분 탐색 | [듣보잡](https://www.acmicpc.net/problem/1764) | [#20](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/20) | +| 6차시 | 2024.05.06 | 기하 | [정사각형](https://www.acmicpc.net/problem/1485) | [#22](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/22) | | 7차시 | 2024.05.08 | 스택, 큐, 덱 | [queuestack](https://www.acmicpc.net/problem/24511) | [#24](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/24) | | 8차시 | 2024.05.13 | 우선순위 큐 | [카드 정렬하기](https://www.acmicpc.net/problem/1715) | [#27](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/27) | | 9차시 | 2024.05.30 | 구현 | [빙고](https://www.acmicpc.net/problem/2578) | [#30](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/30) | | 10차시 | 2024.07.04 | 구현 | [상어초등학교](https://www.acmicpc.net/problem/21608) | [#34](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/34) | +| 11차시 | 2024.07.18 | 이분 탐색 | [랜선 자르기](https://www.acmicpc.net/problem/1654) | [#38](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/38) | --- diff --git "a/oesnuj/\352\265\254\355\230\204/21608.js" "b/oesnuj/\352\265\254\355\230\204/21608.js" index 6c471d4..086a756 100644 --- "a/oesnuj/\352\265\254\355\230\204/21608.js" +++ "b/oesnuj/\352\265\254\355\230\204/21608.js" @@ -74,5 +74,3 @@ function calcSatisfy(){ } } return result; -} -출처: https://oesnuj.tistory.com/entry/Nodejs-백준-Javascript-21608-상어-초등학교 [비트로 그리는 성장일기:티스토리] \ No newline at end of file diff --git "a/oesnuj/\354\235\264\353\266\204 \355\203\220\354\203\211/1654.cpp" "b/oesnuj/\354\235\264\353\266\204 \355\203\220\354\203\211/1654.cpp" new file mode 100644 index 0000000..68051b4 --- /dev/null +++ "b/oesnuj/\354\235\264\353\266\204 \355\203\220\354\203\211/1654.cpp" @@ -0,0 +1,35 @@ +#include +#include +using namespace std; + +bool check(vector & v, int n, long long length); +int binary_serach(vector & v, int n); + +int main() { + int k, n; + cin >> k >> n; + vector v(k); + for (auto& i : v) { + cin >> i; + } + cout << binary_serach(v, n); + return 0; +} + +bool check(vector & v, int n, long long length) { + int cnt = 0; + for (const auto& i : v) { + cnt += i / length; + } + return cnt >= n; +} + +int binary_serach(vector & v, int n) { + long long lo = 1, hi = 2147483648; //자를 수 있는 랜선의 범위 + while (lo + 1 < hi) { + long long mid = (lo + hi) / 2; + if (check(v, n, mid)) lo = mid; + else hi = mid; + } + return lo; +} diff --git "a/oesnuj/\354\235\264\353\266\204\355\203\220\354\203\211/1764.cpp" "b/oesnuj/\354\235\264\353\266\204 \355\203\220\354\203\211/1764.cpp" similarity index 100% rename from "oesnuj/\354\235\264\353\266\204\355\203\220\354\203\211/1764.cpp" rename to "oesnuj/\354\235\264\353\266\204 \355\203\220\354\203\211/1764.cpp"