목록🧠PS (12)
컴퓨터를 공부하고자 마음먹은지 N일차
백준 2292번 벌집 문제링크 CODE const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; function getWay(n) { let comb = 1; let count = 1; while (n > comb) { comb += count * 6; count++; } return count; } rl.on("line", function (line) { input.push(line); }).on("close", function () { const N = +input[0]; let result = getW..
백준 2231번 분해합 문제링크 CODE const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; function divideSum(n) { let m = 0; for (let i = 1; i sum + +cur, 0); if (sum === n) { m = i; break; } } return m; } rl.on("line", function (line) { input.push(line); }).on("close", function () { const N = +input[0]; let result = di..
백준 2164번 카드 2 문제링크 Code 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout,});const input = []; class Node { constructor(value) { this.value = value; this.next = null; this.prev =..
BOJ 2108 통계학 문제링크 CODE 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout,});const input = []; function getAverage(N, nums) { let sum = nums[0]; for (let i = 1; i { if (!mod..
백준 1966번 프린터큐 문제링크 CODE 1234567891011121314151617181920212223242526272829303132333435363738394041424344const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout,});const input = [];rl.on("line", function (line) { input.push(line);}).on("close", function () { input.shift(); for (let i = 0; i +_); const printList = input[i + 1].split("..
백준 1929번 소수 찾기 문제링크 CODE 1234567891011121314151617181920212223242526272829303132const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout,});rl.on("line", function (line) { const [M, N] = line.split(" ").map((_) => +_); const prime = []; for (let num = M; num
백준 1920번 수 찾기 문제링크 CODE 123456789101112131415161718192021const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout,});const input = [];rl.on("line", function (line) { input.push(line); if (input.length === 4) { const [N, A, M, nums] = input; const arrA = new Set(A.split(" ")); nums.split(" ").forEach((el) => { arrA.has(el) ? console...
백준1654 랜선자르기 문제링크 CODE 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; rl.on("line", function (line) { input.push(input.length ? +line : line); const [K, N] = input[0].split(" "); if (inpu..