From 8fc1bbfd7c15caf84126adb49f96431f394f2936 Mon Sep 17 00:00:00 2001 From: sypark Date: Tue, 21 Jun 2022 20:29:59 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[Feat]=20=EC=88=98=EB=A6=AC=EA=B3=B5=20?= =?UTF-8?q?=ED=95=AD=EC=8A=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...54\352\263\265 \355\225\255\354\212\271.kt" | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 "src/6week/seoyoon/\354\210\230\353\246\254\352\263\265 \355\225\255\354\212\271.kt" diff --git "a/src/6week/seoyoon/\354\210\230\353\246\254\352\263\265 \355\225\255\354\212\271.kt" "b/src/6week/seoyoon/\354\210\230\353\246\254\352\263\265 \355\225\255\354\212\271.kt" new file mode 100644 index 0000000..16015eb --- /dev/null +++ "b/src/6week/seoyoon/\354\210\230\353\246\254\352\263\265 \355\225\255\354\212\271.kt" @@ -0,0 +1,18 @@ +package `6week`.seoyoon + +fun main() { + val (N, L) = readln().split(" ").map{ it.toInt() } + val water = readln().split(" ").map{ it.toInt() }.toIntArray() + var cnt = 1 + + water.sort() + var tape = water[0] + L - 0.5 + + for (i in 1 until N) { + if (tape < water[i]) { + cnt++ + tape = water[i] + L - 0.5 + } + } + println(cnt) +} \ No newline at end of file From bbacbad3255252d91464cd99ada3734766f919be Mon Sep 17 00:00:00 2001 From: sypark Date: Wed, 22 Jun 2022 18:23:29 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[Feat]=20=EB=8F=99=EC=A0=84=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "src/6week/seoyoon/\353\217\231\354\240\204 0.kt" | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 "src/6week/seoyoon/\353\217\231\354\240\204 0.kt" diff --git "a/src/6week/seoyoon/\353\217\231\354\240\204 0.kt" "b/src/6week/seoyoon/\353\217\231\354\240\204 0.kt" new file mode 100644 index 0000000..cc1230d --- /dev/null +++ "b/src/6week/seoyoon/\353\217\231\354\240\204 0.kt" @@ -0,0 +1,13 @@ +package `6week`.seoyoon + +fun main() { + var (N, K) = readln().split(" ").map{ it.toInt() } + val coin = IntArray(N) { readln().toInt() } + var cnt = 0 + + for (i in N - 1 downTo 0) { + cnt += K / coin[i] + K = K % coin[i] + } + println(cnt) +} \ No newline at end of file From 4abe63eb52d0e727c56bbcf402f76cff4f63fa9e Mon Sep 17 00:00:00 2001 From: sypark Date: Thu, 23 Jun 2022 20:25:42 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[Feat]=20=EC=8B=A0=EC=9E=85=20=EC=82=AC?= =?UTF-8?q?=EC=9B=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\354\236\205 \354\202\254\354\233\220.kt" | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 "src/6week/seoyoon/\354\213\240\354\236\205 \354\202\254\354\233\220.kt" diff --git "a/src/6week/seoyoon/\354\213\240\354\236\205 \354\202\254\354\233\220.kt" "b/src/6week/seoyoon/\354\213\240\354\236\205 \354\202\254\354\233\220.kt" new file mode 100644 index 0000000..e785247 --- /dev/null +++ "b/src/6week/seoyoon/\354\213\240\354\236\205 \354\202\254\354\233\220.kt" @@ -0,0 +1,24 @@ +package `6week`.seoyoon + +fun main() { + val T = readln().toInt() + repeat(T) { + val N = readln().toInt() + val rank = Array(N, { IntArray(2) }) + var cnt = 1 + + repeat(N) { + rank[it] = readln().split(" ").map{ it.toInt() }.toIntArray() + } + var sorted = rank.sortedBy{ it.first() } + + var compare = sorted[0][1] + repeat(N) { + if (sorted[it][1] < compare) { + cnt++ + compare = sorted[it][1] + } + } + println(cnt) + } +} \ No newline at end of file From af89fe533ab044ebf8e244f19723c3807329e179 Mon Sep 17 00:00:00 2001 From: sypark Date: Mon, 27 Jun 2022 16:47:52 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[Feat]=20=ED=81=B0=20=EC=88=98=20=EB=A7=8C?= =?UTF-8?q?=EB=93=A4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0 \353\247\214\353\223\244\352\270\260.kt" | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 "src/6week/seoyoon/\355\201\260 \354\210\230 \353\247\214\353\223\244\352\270\260.kt" diff --git "a/src/6week/seoyoon/\355\201\260 \354\210\230 \353\247\214\353\223\244\352\270\260.kt" "b/src/6week/seoyoon/\355\201\260 \354\210\230 \353\247\214\353\223\244\352\270\260.kt" new file mode 100644 index 0000000..0007ca1 --- /dev/null +++ "b/src/6week/seoyoon/\355\201\260 \354\210\230 \353\247\214\353\223\244\352\270\260.kt" @@ -0,0 +1,38 @@ +package `6week`.seoyoon + +class `큰 수 만들기` { + companion object { + fun getSolution(): Solution { + return Solution() + } + } + + class Solution { + fun solution(number: String, k: Int): String { + var answer = StringBuilder() + var idx = 0 + + for (i in 0 until number.length) { + if (answer.length == number.length - k) { + return answer.toString() + } + var max = 0 + for (j in idx .. k + i) { + if (number[j].digitToInt() > max) { + max = number[j].digitToInt() + idx = j + 1 + } + } + answer.append(max) + } + return answer.toString() + } + } +} + +fun main() { + val solution = `큰 수 만들기`.getSolution() + println(solution.solution("1924", 2)) + println(solution.solution("1231234", 3)) + println(solution.solution("4177252841", 4)) +} \ No newline at end of file From d5195bd7bf6f3ecaa61f67d932739900940b8a95 Mon Sep 17 00:00:00 2001 From: sypark Date: Mon, 27 Jun 2022 17:27:51 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[Feat]=20=EC=9E=83=EC=96=B4=EB=B2=84?= =?UTF-8?q?=EB=A6=B0=20=EA=B4=84=ED=98=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...62\204\353\246\260 \352\264\204\355\230\270.kt" | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 "src/6week/seoyoon/\354\236\203\354\226\264\353\262\204\353\246\260 \352\264\204\355\230\270.kt" diff --git "a/src/6week/seoyoon/\354\236\203\354\226\264\353\262\204\353\246\260 \352\264\204\355\230\270.kt" "b/src/6week/seoyoon/\354\236\203\354\226\264\353\262\204\353\246\260 \352\264\204\355\230\270.kt" new file mode 100644 index 0000000..2dfd534 --- /dev/null +++ "b/src/6week/seoyoon/\354\236\203\354\226\264\353\262\204\353\246\260 \352\264\204\355\230\270.kt" @@ -0,0 +1,14 @@ +package `6week`.seoyoon + +fun main() { + var answer = 0 + val str = readln().split("-").toMutableList() + repeat(str.size) { + if (str[it].contains("+")) { + var midSum = str[it].split("+").map{ it.toInt() }.reduce{total, sum -> total + sum} + str[it] = midSum.toString() + } + } + answer = str.map{ it.toInt() }.reduce{ total, sum -> total - sum } + println(answer) +} \ No newline at end of file