-
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
[장희직] - 용액, 순회강연, 혼자서 하는 틱택톡, 맥주 마시면서 걸어다니기 #277
Conversation
val bingoPos = listOf( | ||
// 가로 | ||
listOf(0 to 0, 0 to 1, 0 to 2), | ||
listOf(1 to 0, 1 to 1, 1 to 2), | ||
listOf(2 to 0, 2 to 1, 2 to 2), | ||
// 세로 | ||
listOf(0 to 0, 1 to 0, 2 to 0), | ||
listOf(0 to 1, 1 to 1, 2 to 1), | ||
listOf(0 to 2, 1 to 2, 2 to 2), | ||
// 대각 | ||
listOf(0 to 0, 1 to 1, 2 to 2), | ||
listOf(2 to 0, 1 to 1, 0 to 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.
이렇게 미리 구해놓는 것도 깔끔하네요!
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.
진짜 엄청 깔끔하네요...
pos = list(map(int, input().split())) | ||
store_pos.append(pos) | ||
end_pos = list(map(int, input().split())) | ||
store_pos.append(end_pos) |
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.
end_pos를 store_pos에 넣는 방법도 괜찮네요!!
if (lecture.deadline > storeLectures.size) { | ||
storeLectures.add(lecture) | ||
} else { | ||
val smallFeeLecture = storeLectures.peek() | ||
if (lecture.fee > smallFeeLecture.fee) { | ||
storeLectures.poll() | ||
storeLectures.add(lecture) | ||
} | ||
} |
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.
설명을 잘 해주셔서 쉽게 이해했습니다!!
val bingoPos = listOf( | ||
// 가로 | ||
listOf(0 to 0, 0 to 1, 0 to 2), | ||
listOf(1 to 0, 1 to 1, 1 to 2), | ||
listOf(2 to 0, 2 to 1, 2 to 2), | ||
// 세로 | ||
listOf(0 to 0, 1 to 0, 2 to 0), | ||
listOf(0 to 1, 1 to 1, 2 to 1), | ||
listOf(0 to 2, 1 to 2, 2 to 2), | ||
// 대각 | ||
listOf(0 to 0, 1 to 1, 2 to 2), | ||
listOf(2 to 0, 1 to 1, 0 to 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.
진짜 엄청 깔끔하네요...
bingoPos.forEach { posList -> | ||
val bingo = posList.map { pos -> | ||
board[pos.first][pos.second] | ||
} | ||
when (bingo.joinToString("")) { | ||
"OOO" -> isOWin = true | ||
"XXX" -> isXWin = 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.
와 진짜 코드 깔끔하네요
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 (lecture.deadline > storeLectures.size) { | ||
storeLectures.add(lecture) | ||
} else { | ||
val smallFeeLecture = storeLectures.peek() | ||
if (lecture.fee > smallFeeLecture.fee) { | ||
storeLectures.poll() | ||
storeLectures.add(lecture) | ||
} | ||
} |
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 numbers = readln().split(' ').map { it.toInt() } | ||
|
||
var start = 0 | ||
var end = numbers.lastIndex |
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.
👍👍👍
return | ||
} | ||
} | ||
println(answerNumbers.toList().joinToString(" ")) |
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.
요기가 32번째 줄이라면, 절댓값이 0이 되는 경우의 수가 없으면 가장 가까운 절댓값 출력합니다!!
요기가 29라면 절댓값이 0이 나오는 순간 출력하구 return
해요
OCount += row.count { it == 'O' } | ||
XCount += row.count { it == 'X' } | ||
} | ||
if (OCount - XCount !in 0..1) isCorrectGame = false |
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 #276 📌
📋문제 목록📋