Skip to content

Commit

Permalink
Merge pull request #38 from AlgoLeadMe/11-oesnuj
Browse files Browse the repository at this point in the history
11-oesnuj
  • Loading branch information
oesnuj authored Jul 24, 2024
2 parents d4f81c0 + 48b2dd7 commit 5538bc9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
5 changes: 3 additions & 2 deletions oesnuj/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
---
2 changes: 0 additions & 2 deletions oesnuj/κ΅¬ν˜„/21608.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,3 @@ function calcSatisfy(){
}
}
return result;
}
좜처: https://oesnuj.tistory.com/entry/Nodejs-λ°±μ€€-Javascript-21608-상어-μ΄ˆλ“±ν•™κ΅ [λΉ„νŠΈλ‘œ κ·Έλ¦¬λŠ” μ„±μž₯일기:ν‹°μŠ€ν† λ¦¬]
35 changes: 35 additions & 0 deletions oesnuj/이뢄 탐색/1654.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <iostream>
#include <vector>
using namespace std;

bool check(vector <int>& v, int n, long long length);
int binary_serach(vector <int>& v, int n);

int main() {
int k, n;
cin >> k >> n;
vector <int> v(k);
for (auto& i : v) {
cin >> i;
}
cout << binary_serach(v, n);
return 0;
}

bool check(vector <int>& v, int n, long long length) {
int cnt = 0;
for (const auto& i : v) {
cnt += i / length;
}
return cnt >= n;
}

int binary_serach(vector <int>& 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;
}
File renamed without changes.

0 comments on commit 5538bc9

Please sign in to comment.