-
Notifications
You must be signed in to change notification settings - Fork 0
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
[전현수] 그룹 단어 체커, 수리공 항승, 트럭 #59
Conversation
val waitQueue: Queue<Truck> = ArrayDeque() | ||
val processQueue: Queue<Truck> = ArrayDeque() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
정말 스케줄링 하는 것처럼 구현하셔서 챌린지가 떠올랐습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jhg3410
나중에 그거 같이해봐야죠?...ㅎㅎ
waitQueue.add(Truck(weight)) | ||
} | ||
|
||
var isArrived = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
하나씩 이동하니 Boolean 으로 처리해도 되네요!👍 전 filter 를 썼는데
* <문제> | ||
* [수리공 항승](https://www.acmicpc.net/problem/1449) | ||
* | ||
* 물새는 곳을 하나씩 막아보자앗..!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
가즈앗..!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeeminimini
ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ
fun move() { | ||
this.pos++ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data class의 함수로 만든게 깔끔하고 좋았어요 !
val (_, tapeLength) = readln().split(" ").map { it.toInt() } | ||
val leakPositionList = readln().split(" ") | ||
.map { it.toInt() } | ||
.sorted() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
입력받으면서 바로 sort한게 좋네요!
existedWordList.add(this) | ||
} | ||
|
||
targetWord.drop(1).forEach { curChar -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
첫번째 단어를 앞에서 미리 처리해주고 drop처리 해주신 부분 좋네요!
|
||
// 최대 하중 무게만큼 트럭 올리기 | ||
if (waitQueue.isNotEmpty() && | ||
processQueue.sumOf { it.weight } + waitQueue.peek().weight <= bridgeMaxWeight |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
큐도 sum이 되는군요
📌 from issue #56 📌
📋문제 목록📋
📍추가로 해결한 문제📍
📝메모