-
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
[전현수] - 연구소, 친구비, 드래곤 커브, 미세먼지 안녕 #122
Conversation
repeat(row) { rowIndex -> | ||
val rowData = readln().split(" ").map { it.toInt() } as MutableList | ||
rowData.forEachIndexed { columnIndex, value -> | ||
if (value == EMPTY) emptyPositions.add(Position(rowIndex, columnIndex)) |
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.
빈공간을 따로 리스트로 만들어놓는게 훨씬 빠르고 좋은 것 같아요
rowData.forEachIndexed { columnIndex, value -> | ||
if (value != EMPTY && value != AIR_CLEANER) { | ||
|
||
val spreadList = spread(rowIndex, columnIndex) |
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.
저는 맵을 2개 만들어서 처리했는데 확산되는 정보들을 저장해두는 방법두 좋네여
|
||
} | ||
|
||
private fun blowRight(curAir: Position, isFirstAirCleaner: Boolean) { |
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.
위 아래를 하나의 함수로 하려는 노력이 👍
|
||
parent.forEach { | ||
|
||
val parent = getParent(it) |
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.
마지막에 parent 를 찾고 결과를 구하는 방식 👍👍👍
println(maxSafeZoneSize) | ||
} | ||
|
||
private fun findAllCase(cnt: Int = 0, startWith: Int = 0) { |
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.
emptyList를 만들었기때문에 cnt 하나로도 돌 수 있군요!
📌 from issue #120 📌
📋문제 목록📋
📍추가로 해결한 문제📍
📝메모
삼성문제 진짜 토나오네요...