일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 그래프
- 타입 챌린지
- 수학
- 가천대
- 쉬운 문제
- 타입스크립트
- 크롤링
- ip
- BFS
- 자바스크립트
- HTTP 완벽 가이드
- HTTP
- 문자열
- Nestjs
- javascript
- 프로그래머스 레벨 2
- 소켓
- Crawling
- typescript
- TCP
- Node.js
- 백준
- 프로그래머스
- Algorithm
- type challenge
- socket
- 레벨 1
- dfs
- 알고리즘
- dp
- Today
- Total
목록프로그래밍 (478)
kakasoo
// 백준 10103번 주사위 게임을 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); let count = 0; const input = []; rl.on("line", (line) => { if (!count) { count = Number(line); } else { input.push(line); if (input.length === count) { main(); rl.close(); } } }).on("close", () => { process.exit(); }); const main = () => { let ..
kscodebase.tistory.com/394 이전 문제에 JavaScript에 대한 단점들을 조금 나열했는데, 나름대로 깔끔하게 고쳐보고자 이번에는 중첩된 함수 구조를 사용했다. // 백준 11724번 연결요소의 게수를 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; let N = 0; let M = 0; rl.on("line", (line) => { if (!N) { [N, M] = line.split(" ").map(Number); } else { input.push(line);..
// 백준 1260번 DFS와 BFS를 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; let n = 0; let m = 0; let start = 0; rl.on("line", (line) => { if (!n) { [n, m, start] = line.split(" ").map(Number); } else { input.push(line); if (input.length === m) { main(); process.exit(); } } }); const dfs = (start) =>..
const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { main(line); process.exit(); }); /** * * @param {string} line */ const main = (line) => { const numbers = line.split(""); let answer = ""; numbers.forEach((str, i) => { const dex = parseInt(str, 8); let binary = dex.toString(2); while (i !== 0 && ..
// 백준 13023번 ABCDE를 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; let N = 0; let M = 0; rl.on("line", (line) => { if (!N) { [N, M] = line.split(" ").map(Number); } else { input.push(line); if (input.length === M) { main(); process.exit(); } } }); let visited; let arr; let answer = []; /** * *..
// 백준 2747번 배수 찾기를 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); let n = 0; rl.on("line", (line) => { if (!n) { n = Number(line); } else { if (line === "0") { process.exit(); } main(Number(line)); } }); /** * * @param {number} line */ const main = (line) => { if (line % n == 0) { console.log(`${line} is a mult..
// 백준 2747번 피보나치 수를 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { main(Number(line)); rl.close(); }).on("close", () => process.exit()); const memo = [0, 1, 1]; const fibo = (num) => { if (memo[num]) { return memo[num]; } memo[num] = fibo(num - 1) + fibo(num - 2); return memo[num]; }; ..
const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; let count = 0; rl.on("line", (line) => { if (!count) { count = Number(line); } else { input.push(line); if (input.length === count) { main(); rl.close(); } } }).on("close", () => process.exit()); const main = () => { for (let i = 0; i < count; i++) { let..
// 백준 2752번 세수 정렬을 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { main(line); rl.close(); }).on("close", () => process.exit()); /** * * @param {string} line */ const main = (line) => { const numbers = line .split(" ") .map(Number) .sort((a, b) => a - b) .join(" "); console.log(numbers)..
// 백준 1676번 팩토리얼을 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { main(Number(line)); }).on("close", () => process.exit()); /** * * @param {string} line */ const main = (line) => { const five = parseInt(line / 5); const twentyFive = parseInt(line / 25); const fiveHundred = parseInt(line..
// 백준 11653번 소인수분해를 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { main(Number(line)); }).on("close", () => process.exit()); /** * * @param {string} line */ const main = (line) => { const numbers = new Array(line + 1).fill(false); const prime = []; for (let i = 2; i * i
하나씩 출력되게 하려고 했는데, 그러면 메모리 초과가 나왔다. 미리 큰 배열을 만들고 만드는 게 차라리 나을 것으로 보인다. 나도 그럴 목적으로 일단 input을 받은 다음 가장 큰 수 크기만큼의 배열을 만들어주었다. // 백준 6588번 골드바흐의 추측을 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; rl.on("line", (line) => { if (line === "0") { main(); rl.close(); } input.push(Number(line)); }).on("cl..