분류 전체보기
-
문제 번호 : 10799 문제 바로가기 ☞ https://www.acmicpc.net/problem/10799 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\n'); input = input[0].split(''); let arr= []; let cnt= 0; for(let i=0; i
[BaekJoon] 10799 번 쇠막대기 문제 - (nodejs)문제 번호 : 10799 문제 바로가기 ☞ https://www.acmicpc.net/problem/10799 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\n'); input = input[0].split(''); let arr= []; let cnt= 0; for(let i=0; i
2022.01.06 -
문제 번호 : 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 -
문제 번호 : 1181번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1181 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(); let arr = [...new Set(input)].sort((a, b) => a.length - b.length || a.localeCompare(b)); console.log(arr.join('\n')); [배운 점] - 고민 끝에 답을 찾아보았는데, loc..
[BaekJoon] 1181 번 단어 정렬 문제 - (nodejs)문제 번호 : 1181번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1181 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(); let arr = [...new Set(input)].sort((a, b) => a.length - b.length || a.localeCompare(b)); console.log(arr.join('\n')); [배운 점] - 고민 끝에 답을 찾아보았는데, loc..
2022.01.04 -
문제 번호 : 1475번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1475 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString(); let array = new Array(10).fill(0); for(let i of input){ array[i] += 1; } array[6] = (array[6]+array[9])%2 === 0 ? (array[6]+array[9])/2 : Math.floor((array[6]+array[9])/2) + 1; array[..
[BaekJoon] 1475 번 방 번호 문제 - (nodejs)문제 번호 : 1475번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1475 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString(); let array = new Array(10).fill(0); for(let i of input){ array[i] += 1; } array[6] = (array[6]+array[9])%2 === 0 ? (array[6]+array[9])/2 : Math.floor((array[6]+array[9])/2) + 1; array[..
2022.01.04