본문 바로가기

728x90

JavaScript

[NodeJS] 백준 1676 /** * @link https://www.acmicpc.net/problem/1676 */ const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; rl.on('line', (line) => { input.push(Number(line)); }).on('close', () => { const [n] = input; let num = n; let answer = 0; while (5 더보기
[NodeJS] 백준 1620 /** * @link */ const readline = require('readline'); const strToNumberArr = (str) => str.split(' ').map(Number); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; rl.on('line', (line) => { input.push(line); }).on('close', () => { const [n, m] = strToNumberArr(input.shift()); const question = [...Array(m)].map(() => input.pop()).reverse(); c.. 더보기
[NodeJS] 백준 1541 /** * @link https://www.acmicpc.net/problem/1541 */ const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; rl.on('line', (line) => { input.push(line); }).on('close', () => { const result = solution(input[0]); console.log(result); process.exit(); }); /** * * @param {string} str */ function solution(str) { con.. 더보기
[NodeJS] 백준 1389 /** * @link https://www.acmicpc.net/problem/1389 */ const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; const strToNumberArr = (str) => str.split(' ').map(Number); rl.on('line', (line) => { input.push(strToNumberArr(line)); }).on('close', () => { const [[n, m], ...arr] = input; const result = solution(n, .. 더보기
[NodeJS] 백준 1260 /** * @link https://www.acmicpc.net/problem/1260 */ const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; const strToNumberArr = (str) => str.split(' ').map(Number); rl.on('line', (line) => { input.push(line); }).on('close', () => { const [n, m, v] = strToNumberArr(input.shift()); const result = solution(n,.. 더보기
[NodeJS] 백준 1107 /** * @link https://www.acmicpc.net/problem/1107 */ const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; rl.on('line', (line) => { input.push(line); }).on('close', () => { let [n, m] = input; n = Number(n); m = Number(m); let brokenButtons = []; if (m > 0) { brokenButtons = input[2].split(' ').map(Number);.. 더보기
[NodeJS] 백준 1074 /** * @link https://www.acmicpc.net/problem/1074 */ const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; rl.on('line', (line) => { input.push(line); }).on('close', () => { const [n, r, c] = input[0].split(' ').map(Number); solution(n, r, c); process.exit(); }); /** * * @param {number} n * @param {number} r.. 더보기
[NodeJS] 백준 15829 /** * @link https://www.acmicpc.net/problem/15829 */ const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; rl.on('line', (line) => { input.push(line); }).on('close', () => { const [, str] = input; const result = solution(str); console.log(result); process.exit(); }); /** * * @param {string} str */ function .. 더보기

728x90