백준
-
문제 번호 : 5397 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/5397 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\n'); const L = Number(input[0]); for(let i=1; i0) front.push(back.pop()); break; case '-': if(front.length>0) front.pop(); break; default: front.push(text[j]); break; }..
[BaekJoon] 5397 번 키로거 문제 - (nodejs)문제 번호 : 5397 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/5397 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\n'); const L = Number(input[0]); for(let i=1; i0) front.push(back.pop()); break; case '-': if(front.length>0) front.pop(); break; default: front.push(text[j]); break; }..
2022.01.05 -
문제 번호 : 1406번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1406 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\n'); let front = input[0].split(''); let back = []; const num = Number(input[1]); let textlength = front.length; let arr = []; for(let i=0; i 0){ front.push(back.pop());..
[BaekJoon] 1406 번 에디터 문제 - (nodejs)문제 번호 : 1406번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1406 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\n'); let front = input[0].split(''); let back = []; const num = Number(input[1]); let textlength = front.length; let arr = []; for(let i=0; i 0){ front.push(back.pop());..
2022.01.05 -
문제 번호 : 1431 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1431 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\r\n'); input.shift(); input.sort((a, b) => { if (a.length != b.length) return a.length - b.length; let sum1 = sum(a), sum2 = sum(b); if (sum1 == sum2) return a.localeCo..
[BaekJoon] 1431 번 시리얼 번호 문제 - (nodejs)문제 번호 : 1431 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1431 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\r\n'); input.shift(); input.sort((a, b) => { if (a.length != b.length) return a.length - b.length; let sum1 = sum(a), sum2 = sum(b); if (sum1 == sum2) return a.localeCo..
2022.01.05 -
문제 번호 : 2210번 문제 바로가기 ☞ https://www.acmicpc.net/problem/2210 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\r\n'); // 표준입력 테스트를 위해 이렇게 했지만 제출을 위해서는 // split('\r\n') 에서 \r은 제거하고 제출해야합니다. const tables = input.map(el=> el.split(' ')); let visited = Array.from(Array(tables.length)..
[BaekJoon] 2210 번 숫자판 점프 문제 - (nodejs)문제 번호 : 2210번 문제 바로가기 ☞ https://www.acmicpc.net/problem/2210 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\r\n'); // 표준입력 테스트를 위해 이렇게 했지만 제출을 위해서는 // split('\r\n') 에서 \r은 제거하고 제출해야합니다. const tables = input.map(el=> el.split(' ')); let visited = Array.from(Array(tables.length)..
2022.01.03 -
문제 번호 : 2739번 문제 바로가기 ☞ https://www.acmicpc.net/problem/2739 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString(); // 입력 값이 하나일 땐 split을 사용하지 말 것 solution(Number(input)); function solution(A){ let a = A; for(let i=1;i
[BaekJoon] 2739 번 구구단 문제 - (nodejs)문제 번호 : 2739번 문제 바로가기 ☞ https://www.acmicpc.net/problem/2739 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString(); // 입력 값이 하나일 땐 split을 사용하지 말 것 solution(Number(input)); function solution(A){ let a = A; for(let i=1;i
2021.12.28 -
문제 번호 : 1330번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1330 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().split('\n'); input = input[0].split(' '); solution(input[0], input[1]); function solution(A, B){ let a = Number(A); let b = Number(B); if (a>b) console.log('>') else if (a
[BaekJoon] 1330 번 두 수 비교하기 문제 - (nods.js)문제 번호 : 1330번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1330 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().split('\n'); input = input[0].split(' '); solution(input[0], input[1]); function solution(A, B){ let a = Number(A); let b = Number(B); if (a>b) console.log('>') else if (a
2021.12.28