Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

11-oesnuj #38

Merged
merged 7 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}