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

[이지민] 기적의 매매법, 수 이어 쓰기 1, 등수 구하기, DNA #63

Merged
merged 4 commits into from
Jan 1, 2023

Conversation

jeeminimini
Copy link
Member

📌 from issue #61 📌

📋문제 목록📋

기적의 매매법: ✅
수 이어 쓰기 1: ✅
등수 구하기: ✅
DNA: ✅

📍추가로 해결한 문제📍

📝메모

@jeeminimini jeeminimini self-assigned this Dec 31, 2022
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 } }
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 +24 to +30
val scoreList = readLine().split(" ").map { it.toInt() }.toMutableList()
if (n == p) {
if (scoreList.last() >= s) {
println(-1)
return@with
}
}
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 +23 to +30
repeat(q) {
ten *= 10
if (it == q - 1) {
sum += (n - (ten - 1)) * (it + 2)
} else {
sum += (ten * 9) * (it + 2)
}
}
Copy link
Contributor

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 } }
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 +25 to +30
if (n == p) {
if (scoreList.last() >= s) {
println(-1)
return@with
}
}
Copy link
Member

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) {
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 +24 to +27
DNAList.add(readLine())
repeat(m) { idx ->
alphabetList[idx][DNAList.last()[idx] - 'A'] += 1
}
Copy link
Member

Choose a reason for hiding this comment

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

추가하시고 last() 로 접근하신 게 좋았습니다!!

@jeeminimini jeeminimini merged commit 8e97b4d into main Jan 1, 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