백준
-
문제 번호 : 1715 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1715 const fs = require("fs"); const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt"; let input = fs.readFileSync(filePath).toString().split("\r\n"); let heap = [null]; const swap = (a, b) => { [heap[a], heap[b]] = [heap[b], heap[a]]; }; const heappush = (value) => { heap.push(value); let curIdx = heap.length - 1; le..
[BaekJoon] 1715 번 카드 정렬하기 문제 - (nodejs)문제 번호 : 1715 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1715 const fs = require("fs"); const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt"; let input = fs.readFileSync(filePath).toString().split("\r\n"); let heap = [null]; const swap = (a, b) => { [heap[a], heap[b]] = [heap[b], heap[a]]; }; const heappush = (value) => { heap.push(value); let curIdx = heap.length - 1; le..
2022.05.04 -
문제 번호 : 16234번 문제 바로가기 ☞ https://www.acmicpc.net/problem/16234 const fs = require("fs"); const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt"; let input = fs.readFileSync(filePath).toString().trim().split("\r\n"); const [N, L, R] = input[0].split(" ").map(Number); // 정사각형 땅 const array = []; // 몇번이나 이동했는지 let moveCount = 0; for (let i = 0; i < N; i++) { array.push(input[i..
[BaekJoon] 16234 번 인구 이동 문제 - (nodejs)문제 번호 : 16234번 문제 바로가기 ☞ https://www.acmicpc.net/problem/16234 const fs = require("fs"); const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt"; let input = fs.readFileSync(filePath).toString().trim().split("\r\n"); const [N, L, R] = input[0].split(" ").map(Number); // 정사각형 땅 const array = []; // 몇번이나 이동했는지 let moveCount = 0; for (let i = 0; i < N; i++) { array.push(input[i..
2022.04.27 -
문제 번호 : 2003 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/2003 const fs = require("fs"); const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt"; let input = fs.readFileSync(filePath).toString().trim().split("\n"); let left = 0; let right = 0; let [N, target] = input[0].split(" ").map(Number); const array = input[1].split(" ").map(Number); let sum = 0; let count = 0; while (r..
[BaekJoon] 2003 번 수 들의 합 2 문제 - (nodejs)문제 번호 : 2003 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/2003 const fs = require("fs"); const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt"; let input = fs.readFileSync(filePath).toString().trim().split("\n"); let left = 0; let right = 0; let [N, target] = input[0].split(" ").map(Number); const array = input[1].split(" ").map(Number); let sum = 0; let count = 0; while (r..
2022.02.17 -
문제 번호 : 3745 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/3745 const fs = require("fs"); const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt"; let input = fs.readFileSync(filePath).toString().trim().split("\n"); for (let i = 0; i < input.length; i += 2) { let N = input[i]; // 안씀 let array = input[i + 1].trim().split(/\s+/g).map(Number); let temp = []; // lower bound. 그러나 이..
[BaekJoon] 3745 번 오름세 문제 - (nodejs)문제 번호 : 3745 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/3745 const fs = require("fs"); const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt"; let input = fs.readFileSync(filePath).toString().trim().split("\n"); for (let i = 0; i < input.length; i += 2) { let N = input[i]; // 안씀 let array = input[i + 1].trim().split(/\s+/g).map(Number); let temp = []; // lower bound. 그러나 이..
2022.02.14 -
문제 번호 : 16932 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/16932 const fs = require("fs"); const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt"; let input = fs.readFileSync(filePath).toString().trim().split("\n"); const [N, M] = input[0].split(" ").map(Number); let board = []; let groupSize = []; let answer = []; for (let i = 1; i < N + 1; i++) { board.push(input[i].split(..
[BaekJoon] 16932 번 모양 만들기 문제 - (nodejs)문제 번호 : 16932 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/16932 const fs = require("fs"); const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt"; let input = fs.readFileSync(filePath).toString().trim().split("\n"); const [N, M] = input[0].split(" ").map(Number); let board = []; let groupSize = []; let answer = []; for (let i = 1; i < N + 1; i++) { board.push(input[i].split(..
2022.02.10 -
문제 번호 : 2644 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/2644 const fs = require("fs"); const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt"; let input = fs.readFileSync(filePath).toString().trim().split("\n"); const N = Number(input.shift()); let graph = Array.from(Array(N + 1), () => new Array(0)); const [a, b] = input[0].split(" ").map(Number); const graphLen = Number(..
[BaekJoon] 2644 번 촌수계산 문제 - (nodejs)문제 번호 : 2644 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/2644 const fs = require("fs"); const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt"; let input = fs.readFileSync(filePath).toString().trim().split("\n"); const N = Number(input.shift()); let graph = Array.from(Array(N + 1), () => new Array(0)); const [a, b] = input[0].split(" ").map(Number); const graphLen = Number(..
2022.02.09