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

[전현수] 그룹 단어 체커, 수리공 항승, 트럭 #59

Merged
merged 3 commits into from
Dec 4, 2022

Conversation

soopeach
Copy link
Member

@soopeach soopeach commented Dec 4, 2022

📌 from issue #56 📌

📋문제 목록📋

그룹 단어 체커: ✅
수리공 항승: ✅
트럭: ✅
안녕: ❎

📍추가로 해결한 문제📍

📝메모

  • Dp... 진짜 어떻게 풀죠...

@soopeach soopeach added the 현수 label Dec 4, 2022
@soopeach soopeach self-assigned this Dec 4, 2022
Comment on lines +21 to +22
val waitQueue: Queue<Truck> = ArrayDeque()
val processQueue: Queue<Truck> = ArrayDeque()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정말 스케줄링 하는 것처럼 구현하셔서 챌린지가 떠올랐습니다

Copy link
Member Author

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
Copy link
Member

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)
*
* 물새는 곳을 하나씩 막아보자앗..!!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

가즈앗..!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeeminimini
ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ

Comment on lines +14 to +16
fun move() {
this.pos++
}
Copy link
Member

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()
Copy link
Member

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 ->
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

큐도 sum이 되는군요

@soopeach soopeach merged commit 3d5f8a4 into main Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants