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

[전현수] - 연구소, 친구비, 드래곤 커브, 미세먼지 안녕 #122

Merged
merged 5 commits into from
Mar 26, 2023

Conversation

soopeach
Copy link
Member

📌 from issue #120 📌

📋문제 목록📋

연구소: ✅
친구비: ✅
드래곤 커브: ⛔️
미세먼지 안녕!: ✅

📍추가로 해결한 문제📍

추천: 👍  
비추천: 👎  
문제에 대한 간단한 코멘트를 남겨주셔도 좋을 것 같아요!

📝메모

삼성문제 진짜 토나오네요...

  • 2차원 좌표를 넘 헷갈리게 줘가지고... 문제를 제대로 안 읽는 제 탓이겟죠,,,

@soopeach soopeach self-assigned this Mar 26, 2023
repeat(row) { rowIndex ->
val rowData = readln().split(" ").map { it.toInt() } as MutableList
rowData.forEachIndexed { columnIndex, value ->
if (value == EMPTY) emptyPositions.add(Position(rowIndex, columnIndex))
Copy link
Contributor

Choose a reason for hiding this comment

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

빈공간을 따로 리스트로 만들어놓는게 훨씬 빠르고 좋은 것 같아요

rowData.forEachIndexed { columnIndex, value ->
if (value != EMPTY && value != AIR_CLEANER) {

val spreadList = spread(rowIndex, columnIndex)
Copy link
Contributor

Choose a reason for hiding this comment

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

저는 맵을 2개 만들어서 처리했는데 확산되는 정보들을 저장해두는 방법두 좋네여


}

private fun blowRight(curAir: Position, isFirstAirCleaner: Boolean) {
Copy link
Member

Choose a reason for hiding this comment

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

위 아래를 하나의 함수로 하려는 노력이 👍


parent.forEach {

val parent = getParent(it)
Copy link
Member

Choose a reason for hiding this comment

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

마지막에 parent 를 찾고 결과를 구하는 방식 👍👍👍

println(maxSafeZoneSize)
}

private fun findAllCase(cnt: Int = 0, startWith: Int = 0) {
Copy link
Member

Choose a reason for hiding this comment

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

emptyList를 만들었기때문에 cnt 하나로도 돌 수 있군요!

@soopeach soopeach merged commit 65e3fa3 into main Mar 26, 2023
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