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

[장희직] - 용액, 순회강연, 혼자서 하는 틱택톡, 맥주 마시면서 걸어다니기 #277

Merged
merged 3 commits into from
Jun 9, 2024

Conversation

jhg3410
Copy link
Member

@jhg3410 jhg3410 commented Jun 9, 2024

📌 from issue #276 📌

📋문제 목록📋

용액: ✅
순회강연: ✅
혼자서 하는 틱택톡: ⛔️
맥주 마시면서 걸어다니기: ✅

@jhg3410 jhg3410 added the 희직 label Jun 9, 2024
@jhg3410 jhg3410 self-assigned this Jun 9, 2024
Comment on lines +4 to +16
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),
)
Copy link
Member

Choose a reason for hiding this comment

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

이렇게 미리 구해놓는 것도 깔끔하네요!

Copy link
Contributor

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

Choose a reason for hiding this comment

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

end_pos를 store_pos에 넣는 방법도 괜찮네요!!

Comment on lines +27 to +35
if (lecture.deadline > storeLectures.size) {
storeLectures.add(lecture)
} else {
val smallFeeLecture = storeLectures.peek()
if (lecture.fee > smallFeeLecture.fee) {
storeLectures.poll()
storeLectures.add(lecture)
}
}
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 +4 to +16
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),
)
Copy link
Contributor

Choose a reason for hiding this comment

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

진짜 엄청 깔끔하네요...

Comment on lines +31 to +39
bingoPos.forEach { posList ->
val bingo = posList.map { pos ->
board[pos.first][pos.second]
}
when (bingo.joinToString("")) {
"OOO" -> isOWin = true
"XXX" -> isXWin = true
}
}
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

@soopeach soopeach left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

Comment on lines +27 to +35
if (lecture.deadline > storeLectures.size) {
storeLectures.add(lecture)
} else {
val smallFeeLecture = storeLectures.peek()
if (lecture.fee > smallFeeLecture.fee) {
storeLectures.poll()
storeLectures.add(lecture)
}
}
Copy link
Member

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

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

Choose a reason for hiding this comment

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

요기 도는 경우가 있나요??

Copy link
Member Author

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

Choose a reason for hiding this comment

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

요거 엄청 직관적인 것 같아요

@jhg3410 jhg3410 merged commit 00a4495 into main Jun 9, 2024
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