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

[전현수] - 쉬운 최단거리, 겹치는 건 싫어, 기타리스트, 회전 초밥 #167

Merged
merged 4 commits into from
Sep 3, 2023

Conversation

soopeach
Copy link
Member

@soopeach soopeach commented Sep 3, 2023

📌 from issue #165 📌

📋문제 목록📋

쉬운 최단거리: ✅
겹치는 건 싫어: ⛔️
기타리스트: ⛔️
회전 초밥: ✅

📍추가로 해결한 문제📍

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

📝메모

공유하고 싶은 정보, 새롭게 알게된 것, 문제를 풀면서 발생한 에로사항 등...자유롭게!


@soopeach soopeach added the 현수 label Sep 3, 2023
@soopeach soopeach self-assigned this Sep 3, 2023
Comment on lines +25 to +37
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
}

}
}
Copy link
Contributor

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

Choose a reason for hiding this comment

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

오...! 이런 방법이

Copy link
Member

Choose a reason for hiding this comment

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

오???

Comment on lines +38 to +41
2 -> {
targetPosition = Position(xIndex, yIndex)
2
}
Copy link
Contributor

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

Choose a reason for hiding this comment

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

코틀린은 이런게 참 좋네요

Comment on lines +41 to +42
start++
if (n <= start) break
Copy link
Member

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

Choose a reason for hiding this comment

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

오???

Comment on lines +36 to +37
val intValue = value.toInt()
when (intValue) {
Copy link
Member

Choose a reason for hiding this comment

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

when ( value.toInt()) {

이렇게는 어떨까요!?😀

Copy link
Member Author

Choose a reason for hiding this comment

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

좋아요

@soopeach soopeach merged commit d2e34d3 into main Sep 3, 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