
const fs = require("fs"); const filePath = process.platform === "linux" ? "./input.txt" : "/dev/stdin"; //제 개발환경은 리눅스이기에 input.txt를 앞에 두었습니다. // const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; // 실제 백준사이트에 제출할 때는 위에 filePath를 삭제하고 이 부분을 입력하면 됩니다. let input = fs.readFileSync(filePath).toString(); // .split()이 붙어있으면 오류가 납니다 틀렸다고 나와요 input = +input; //console.log(input..

저의 방식대로 풀었으나 for문을 너무 많이써서 시간이 오래걸리는 단점이 있어서 다른사람의 코드를 보고 배웠습니다. 1. 저의방식 function selfNumber(A) { let sum = 0; let allSum = 0; let numberArr = []; for (let k in A) { //console.log(A[k]); sum = sum + Number(A[k]); } allSum = Number(A) + sum; allSum = allSum.toString(); //numberArr.push(+allSum); for (let i = 0; i < 594; i++) { sum = 0; for (let m in allSum) { sum = sum + Number(allSum[m]); } allS..

const fs = require("fs"); const filePath = process.platform === "linux" ? "./input.txt" : "/dev/stdin"; //제 개발환경은 리눅스이기에 input.txt를 앞에 두었습니다. // const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; // 실제 백준사이트에 제출할 때는 위에 filePath를 삭제하고 이 부분을 입력하면 됩니다. let input = fs.readFileSync(filePath).toString().split("\n"); // console.log(input); // console.log(input); let testCount..

const fs = require("fs"); const filePath = process.platform === "linux" ? "./input.txt" : "/dev/stdin"; //제 개발환경은 리눅스이기에 input.txt를 앞에 두었습니다. // const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; // 실제 백준사이트에 제출할 때는 위에 filePath를 삭제하고 이 부분을 입력하면 됩니다. let input = fs.readFileSync(filePath).toString().split("\n"); //console.log(input); let testCount = +input[0]; solution(i..

const fs = require("fs"); const filePath = process.platform === "linux" ? "./input.txt" : "/dev/stdin"; //제 개발환경은 리눅스이기에 input.txt를 앞에 두었습니다. // const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; // 실제 백준사이트에 제출할 때는 위에 filePath를 삭제하고 이 부분을 입력하면 됩니다. let input = fs.readFileSync(filePath).toString().split("\n"); let testCount = +input[0]; input = input[1].split(" ").map(..

const fs = require("fs"); const filePath = process.platform === "linux" ? "./input.txt" : "/dev/stdin"; //제 개발환경은 리눅스이기에 input.txt를 앞에 두었습니다. // const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; // 실제 백준사이트에 제출할 때는 위에 filePath를 삭제하고 이 부분을 입력하면 됩니다. let input = fs.readFileSync(filePath).toString().split("\n"); input = input.map((item) => +item); //console.log(input); s..

const fs = require("fs"); const filePath = process.platform === "linux" ? "./input.txt" : "/dev/stdin"; //제 개발환경은 리눅스이기에 input.txt를 앞에 두었습니다. // const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; // 실제 백준사이트에 제출할 때는 위에 filePath를 삭제하고 이 부분을 입력하면 됩니다. let input = fs.readFileSync(filePath).toString().split("\n"); input = input.map((item) => +item); //console.log(input); s..

const fs = require("fs"); const filePath = process.platform === "linux" ? "./input.txt" : "/dev/stdin"; //제 개발환경은 리눅스이기에 input.txt를 앞에 두었습니다. // const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; // 실제 백준사이트에 제출할 때는 위에 filePath를 삭제하고 이 부분을 입력하면 됩니다. let input = fs.readFileSync(filePath).toString().split("\n"); input = input.map((item) => +item); //console.log(input); s..
- Total
- Today
- Yesterday
- 윤성우 열혈C프로그래밍
- import/order
- 초보
- nodejs
- createPortal
- 우아한테크코스
- 스토리 북
- CLASS
- NextApiRequest
- TopLayer
- WSL2
- error
- 아차산
- 프론트앤드
- C언어
- 노마드코더
- Storybook
- electron
- javascript
- jest
- NextRequest
- React
- 위코드
- 노개북
- 프리온보딩
- nextjs
- 북클럽
- 원티드
- env
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 |