-
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
[전현수] - 쉬운 최단거리, 겹치는 건 싫어, 기타리스트, 회전 초밥 #167
Conversation
for (i in 0 until songCnt) { | ||
for (j in 0..limit) { | ||
|
||
if (dp[i][j]) { | ||
val min = j - volumeList[i] | ||
val max = j + volumeList[i] | ||
|
||
if (min in 0..limit) dp[i + 1][min] = true | ||
if (max in 0..limit) dp[i + 1][max] = true | ||
} | ||
|
||
} | ||
} |
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.
dp 잘 참고하겠습니다 호호...
|
||
val (n, m) = readln().split(" ").map { it.toInt() } | ||
|
||
map = Array(n) { xIndex -> |
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.
오???
2 -> { | ||
targetPosition = Position(xIndex, yIndex) | ||
2 | ||
} |
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.
이런 문법도 다 까먹었네요...큐ㅠㅠㅠ 덕분에 복기 완료,,
} | ||
} | ||
|
||
println(dp.last().lastIndexOf(true)) |
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.
코틀린은 이런게 참 좋네요
start++ | ||
if (n <= start) break |
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.
if (n <= ++start) break
이렇게도 가능할 것 같슴다!
|
||
val (n, m) = readln().split(" ").map { it.toInt() } | ||
|
||
map = Array(n) { xIndex -> |
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.
오???
val intValue = value.toInt() | ||
when (intValue) { |
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.
when ( value.toInt()) {
이렇게는 어떨까요!?😀
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.
좋아요
📌 from issue #165 📌
📋문제 목록📋
📍추가로 해결한 문제📍
📝메모
공유하고 싶은 정보, 새롭게 알게된 것, 문제를 풀면서 발생한 에로사항 등...자유롭게!