-
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
[이지민] 기적의 매매법, 수 이어 쓰기 1, 등수 구하기, DNA #63
Conversation
fun main(): Unit = with(BufferedReader(InputStreamReader(System.`in`))) { | ||
val (n, m) = readLine().split(" ").map { it.toInt() } | ||
val DNAList = mutableListOf<String>() | ||
val alphabetList = MutableList(m) { MutableList(26) { 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.
알파벳 리스트로 해서 인덱스 변환을 쉽게 하신 게 멋졌습니다!
val scoreList = readLine().split(" ").map { it.toInt() }.toMutableList() | ||
if (n == p) { | ||
if (scoreList.last() >= s) { | ||
println(-1) | ||
return@with | ||
} | ||
} |
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.
지민님은 진짜 가지치기 장인이신 거 같아요....👍👍
repeat(q) { | ||
ten *= 10 | ||
if (it == q - 1) { | ||
sum += (n - (ten - 1)) * (it + 2) | ||
} else { | ||
sum += (ten * 9) * (it + 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.
엄청 깔끔하네요 멋있습니다...
fun main(): Unit = with(BufferedReader(InputStreamReader(System.`in`))) { | ||
val (n, m) = readLine().split(" ").map { it.toInt() } | ||
val DNAList = mutableListOf<String>() | ||
val alphabetList = MutableList(m) { MutableList(26) { 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.
문자를 인덱스로 두고 푸신게 인상 깊네요!!
if (n == p) { | ||
if (scoreList.last() >= s) { | ||
println(-1) | ||
return@with | ||
} | ||
} |
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.
예외를 엄청 깔끔하게 미리 정의해주셨군요..!! 좋은 것 같아요
var ten = 1 | ||
repeat(q) { | ||
ten *= 10 | ||
if (it == q - 1) { |
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.
같은 로직인데 수로 표현하셔서 대단하신 것 같아요!
DNAList.add(readLine()) | ||
repeat(m) { idx -> | ||
alphabetList[idx][DNAList.last()[idx] - 'A'] += 1 | ||
} |
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.
추가하시고 last() 로 접근하신 게 좋았습니다!!
📌 from issue #61 📌
📋문제 목록📋
📍추가로 해결한 문제📍
📝메모