본문 바로가기

전체 글33

1100. 하얀 칸 - Node.js https://www.acmicpc.net/problem/1100 const fs = require('fs');const file_path = process.platform === 'linux' ? 'dev/stdin' : `${__dirname}/input.txt`const input = fs.readFileSync(file_path).toString().trim().replace(/\r/g, '').split('\n');/** * @param {string[]} input * @returns */const solution = (input) => { const line_odd = [0, 2, 4, 6]; const line_even = [1, 3, 5, 7]; const re.. 2024. 9. 14.
1076. 저항 - Node.js const fs = require('fs');const file_path = process.platform === 'linux' ? 'dev/stdin' : `${__dirname}/input.txt`const input = fs.readFileSync(file_path).toString().trim().replace(/\r/g, '').split('\n');/** * @param {string} input * @returns */const solution = (input) => { const [f_key, s_key, pow_key] = input; const resistance = ['black', 'brown', 'red', 'orange', 'yellow', 'green', 'blu.. 2024. 9. 12.
1075. 나누기 - Node.js const fs = require('fs');const file_path = process.platform === 'linux' ? 'dev/stdin' : `${__dirname}/input.txt`const input = fs.readFileSync(file_path).toString().trim().split('\n') .map(el => el.replace(/\r/g, '')) .map(el => Number(el));/** * @param {string} input * @returns {string} */const solution = (input) => { const [n, f] = input; const n_str = n.toString(); const n_str_.. 2024. 9. 12.
1009. 분산처리 - Node.js const fs = require('fs');const file_path = process.platform === 'linux' ? 'dev/stdin' : `${__dirname}/input.txt`const input = fs.readFileSync(file_path) .toString() .trim() .split('\n') .map(el => el.replace(/\r/g, '').split(' ')); // a ** b의 마지막 자리 수가 필요함// 거듭제곱의 첫 번쨰 자리는 4번의 거듭제곱마다 반복// 또한 13, 28, ...등 1자리 이상의 밑 또한 1의 자.. 2024. 9. 12.
2024/06/12 - 오랜만에 적는 글 보호되어 있는 글 입니다. 2024. 6. 12.
2024/06/06 - 남산과 못다한 일 보호되어 있는 글 입니다. 2024. 6. 7.