Skip to content

Commit

Permalink
Merge pull request #148 from AlgoLeadMe/8-jung0115
Browse files Browse the repository at this point in the history
8-jung0115
  • Loading branch information
jung0115 authored Sep 24, 2024
2 parents 15a9e3d + b8b7ed4 commit eeed301
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
3 changes: 2 additions & 1 deletion jung0115/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
| 4차시 | 2024.07.27.토 | 트리 / 트라이 | [개미굴(14725)](https://www.acmicpc.net/problem/14725) | https://github.com/AlgoLeadMe/AlgoLeadMe-4/pull/134 |
| 5차시 | 2024.07.31.수 | 트리 / MST | [1251. [S/W 문제해결 응용] 4일차 - 하나로](https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV15StKqAQkCFAYD) | https://github.com/AlgoLeadMe/AlgoLeadMe-4/pull/137 |
| 6차시 | 2024.08.03.토 | 트리 / 트라이 | [디스크 트리(7432)](https://www.acmicpc.net/problem/7432) | https://github.com/AlgoLeadMe/AlgoLeadMe-4/pull/142 |
| 7차시 | 2024.08.07.수 | 다익스트라 | [지형이동](https://school.programmers.co.kr/learn/courses/30/lessons/62050) | https://github.com/AlgoLeadMe/AlgoLeadMe-4/pull/144 |
| 7차시 | 2024.08.07.수 | 다익스트라 | [지형 이동(Lv.4)](https://school.programmers.co.kr/learn/courses/30/lessons/62050) | https://github.com/AlgoLeadMe/AlgoLeadMe-4/pull/144 |
| 8차시 | 2024.08.19.월 | 이분 탐색 | [입국심사(Lv.3)](https://school.programmers.co.kr/learn/courses/30/lessons/43238) | https://github.com/AlgoLeadMe/AlgoLeadMe-4/pull/148 |
1 change: 0 additions & 1 deletion jung0115/다익스트라/Programmers_62050.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public Point(int x, int y, int cost) {
this.cost = cost;
}


// 우선순위: 비용이 작은 순
@Override
public int compareTo(Point o) {
Expand Down
24 changes: 24 additions & 0 deletions jung0115/이분 탐색/Programmers_43238.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// 8차시 2024.08.19.월 : 프로그래머스 - 입국심사(Lv.3)
class Solution {
fun solution(n: Int, times: IntArray): Long {
var min: Long = 0
var max: Long = (times.maxOrNull()!!.toLong() * n)

while (min < max) {
val mid: Long = (min + max) / 2
var complete: Long = 0

for (time in times) {
complete += mid / time
}

if (complete >= n) {
max = mid
} else {
min = mid + 1
}
}

return min
}
}

0 comments on commit eeed301

Please sign in to comment.