[node.js] 백준 10844번 쉬운 계단 수
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; const memo = [...new Array(n + 1).keys()].map(() => []); memo[1] = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1]; memo[2] = [1, 1, 2, 2, 2, 2, 2, 2, 2, 1]; for(let i = 3; i { ..
더보기
[Node.js]백준 1316번
link: www.acmicpc.net/problem/1316 1316번: 그룹 단어 체커 그룹 단어란 단어에 존재하는 모든 문자에 대해서, 각 문자가 연속해서 나타나는 경우만을 말한다. 예를 들면, ccazzzzbb는 c, a, z, b가 모두 연속해서 나타나고, kin도 k, i, n이 연속해서 나타나기 때 www.acmicpc.net 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', () =..
더보기