일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 타입스크립트
- 알고리즘
- 쉬운 문제
- 크롤링
- type challenge
- typescript
- Node.js
- ip
- 프로그래머스
- TCP
- 그래프
- Algorithm
- 레벨 1
- dp
- 자바스크립트
- 문자열
- Crawling
- HTTP 완벽 가이드
- HTTP
- Nestjs
- 가천대
- 프로그래머스 레벨 2
- 수학
- 소켓
- dfs
- socket
- 백준
- BFS
- javascript
- 타입 챌린지
- Today
- Total
목록프로그래밍/알고리즘 풀이 (210)
kakasoo
// 백준 2145번 숫자놀이를 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { if (line === "0") { rl.close(); } main(line); }).on("close", () => { process.exit(); }); /** * * @param {string} line */ const main = (line) => { let numbers = line.split(""); const sumOfString = (acc, cur) => { acc = Num..
const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { if (line === "# 0 0") { rl.close(); } main(line); }).on("close", () => { process.exit(); }); /** * * @param {string} line */ const main = (line) => { const [name, age, weight] = line.split(" "); if (age > 17 || weight >= 80) { console.log(`${name..
// 백준 1357번 뒤집힌 덧셈을 풀었습니다. 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) => { console.log(parseInt(line, 16)); }; 뭐 이렇게 쉬운 문제를 푸나 싶다만은, 이유가 있다. 첫째로는 진법 변환과 관련된 문제들을 풀어보려고 했었고, 두번..
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()); const reverseString = (el) => { let newString = ""; for (let i = el.length - 1; i >= 0; i--) { newString += el[i]; } return newString; }; /** * * @param {string} line */ const main = (..
두 개의 코드를 제공한다. 그 외에도 틀린 경우가 많았지만, 가장 대표적인 틀린(?) 코드와, 정답을 작성한다. 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) => { // 1. 2진수를 10진수로 변환한다. let ten = BigInt(0); for (let i = 0;..
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) => { let [N, B] = line.split(" "); N = Number(N); const numbers = []; let square = 0; while (N >= B) { const value = N % B; num..
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 [N, B] = line.split(" "); const length = N.length; const numbers = N.split("").map((el, i) => { return { value: el, ..
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); main(line); if (input.length === count) { rl.close(); } } }).on("close", () => { process.exit(); }); const gcd = (A, B) => { if (B === 0) { return A; ..
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); main(line); if (input.length === count) { rl.close(); } } }).on("close", () => { process.exit(); }); const gcd = (A, B) => { if (B === 0) { return A; ..
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(); }); const gcd = (A, B) => { if (B === 0) { return A; } else { return gcd(B, A % B); } }; /** * * @param {string} line */ const main = (line) => { const [A, B] = line.split(" ").map(Nu..
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 [A, B, C] = line.split(" ").map(Number); console.log((A + B) % C); console.log(((A % C) + (B % C)) % C); console.log..
꽤 어려웠다. // 백준 14501번 퇴사 문제를 풀었습니다. 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 === 0) { count = Number(line); } else { input.push(line); if (input.length === count) { main(); rl.close(); } } }).on("close", () => { process.exit(); }); const main = ..