From d44def0323c9b45ab79b65af2576a946ca7e1e80 Mon Sep 17 00:00:00 2001 From: simeunseo Date: Fri, 10 Nov 2023 21:38:52 +0900 Subject: [PATCH 1/3] =?UTF-8?q?lv1:=20=EB=AA=85=EC=98=88=EC=9D=98=20?= =?UTF-8?q?=EC=A0=84=EB=8B=B9(1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\354\235\230 \354\240\204\353\213\271(1).js" | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 "\354\235\200\354\204\234/week5/\353\252\205\354\230\210\354\235\230 \354\240\204\353\213\271(1).js" diff --git "a/\354\235\200\354\204\234/week5/\353\252\205\354\230\210\354\235\230 \354\240\204\353\213\271(1).js" "b/\354\235\200\354\204\234/week5/\353\252\205\354\230\210\354\235\230 \354\240\204\353\213\271(1).js" new file mode 100644 index 0000000..9f15eb7 --- /dev/null +++ "b/\354\235\200\354\204\234/week5/\353\252\205\354\230\210\354\235\230 \354\240\204\353\213\271(1).js" @@ -0,0 +1,17 @@ +function solution(k, score) { + const honor = []; + const ans = []; + + score.forEach((n) => { + honor.push(n); + honor.sort((a, b) => b - a); + + if (honor.length >= k) { + ans.push(honor[k - 1]); + } else { + ans.push(honor[honor.length - 1]); + } + }); + + return ans; +} From e271b1e2aff0fb5ab3b67dcb38e8230c14abeb76 Mon Sep 17 00:00:00 2001 From: simeunseo Date: Sat, 11 Nov 2023 11:54:53 +0900 Subject: [PATCH 2/3] =?UTF-8?q?lv1:=20=EA=B8=B0=EC=82=AC=EB=8B=A8=EC=9B=90?= =?UTF-8?q?=EC=9D=98=20=EB=AC=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\354\235\230 \353\254\264\352\270\260.js" | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 "\354\235\200\354\204\234/week5/\352\270\260\354\202\254\353\213\250\354\233\220\354\235\230 \353\254\264\352\270\260.js" diff --git "a/\354\235\200\354\204\234/week5/\352\270\260\354\202\254\353\213\250\354\233\220\354\235\230 \353\254\264\352\270\260.js" "b/\354\235\200\354\204\234/week5/\352\270\260\354\202\254\353\213\250\354\233\220\354\235\230 \353\254\264\352\270\260.js" new file mode 100644 index 0000000..23aa200 --- /dev/null +++ "b/\354\235\200\354\204\234/week5/\352\270\260\354\202\254\353\213\250\354\233\220\354\235\230 \353\254\264\352\270\260.js" @@ -0,0 +1,20 @@ +function solution(number, limit, power) { + var answer = 0; + for (let i = 1; i <= number; i++) { + let count = 0; + for (let j = 1; j <= i / 2; j++) { + if (i % j === 0) { + count += 1; + } + } + + count += 1; + + if (count > limit) { + answer += power; + } else { + answer += count; + } + } + return answer; +} From 340e023819b2fa1cc4d87c4c3c17d62d31e365b8 Mon Sep 17 00:00:00 2001 From: simeunseo Date: Sun, 12 Nov 2023 22:56:13 +0900 Subject: [PATCH 3/3] =?UTF-8?q?lv1:=20=EC=BD=9C=EB=9D=BC=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...75\234\353\235\274 \353\254\270\354\240\234.js" | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 "\354\235\200\354\204\234/week5/\354\275\234\353\235\274 \353\254\270\354\240\234.js" diff --git "a/\354\235\200\354\204\234/week5/\354\275\234\353\235\274 \353\254\270\354\240\234.js" "b/\354\235\200\354\204\234/week5/\354\275\234\353\235\274 \353\254\270\354\240\234.js" new file mode 100644 index 0000000..c3d33c3 --- /dev/null +++ "b/\354\235\200\354\204\234/week5/\354\275\234\353\235\274 \353\254\270\354\240\234.js" @@ -0,0 +1,14 @@ +const solution = (a, b, n) => { + let ans = 0; + let remain = n; + + while (true) { + if (a > remain) { + break; + } + ans += parseInt(remain / a) * b; + remain = parseInt(remain / a) * b + (remain % a); + } + + return ans; +};