Baekjoon
-
문제 번호 : 10815번 문제 바로가기 ☞ https://www.acmicpc.net/problem/10815 const { reverse } = require('dns'); const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\n'); let first_card = input[1].split(' '); let second_card = input[3].split(' '); let answer = []; first_card.sort(); for(let i of ..
[BaekJoon] 10815 번 숫자 카드 문제 - (nodejs)문제 번호 : 10815번 문제 바로가기 ☞ https://www.acmicpc.net/problem/10815 const { reverse } = require('dns'); const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\n'); let first_card = input[1].split(' '); let second_card = input[3].split(' '); let answer = []; first_card.sort(); for(let i of ..
2022.01.08 -
문제 번호 : 4889번 문제 바로가기 ☞ https://www.acmicpc.net/problem/4889 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 in input){ let temp = input[i].split(''); let arr = []; let cnt = 0; if(temp[0] === '-') break; for(let j in temp){ if(temp[j] === '{'){ arr.push(temp[j])..
[BaekJoon] 4889 번 안정적인 문자열 문제 - (nodejs)문제 번호 : 4889번 문제 바로가기 ☞ https://www.acmicpc.net/problem/4889 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 in input){ let temp = input[i].split(''); let arr = []; let cnt = 0; if(temp[0] === '-') break; for(let j in temp){ if(temp[j] === '{'){ arr.push(temp[j])..
2022.01.07 -
문제 번호 : 1662번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1662 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\r\n'); input = input[0].split(''); let arr = []; let front = 0; let answer = new Array(20).fill(0); for(let i in input){ if(input[i] === ')'){ let temp = ""; while(true)..
[BaekJoon] 1662 번 압축 문제 - (nodejs)문제 번호 : 1662번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1662 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\r\n'); input = input[0].split(''); let arr = []; let front = 0; let answer = new Array(20).fill(0); for(let i in input){ if(input[i] === ')'){ let temp = ""; while(true)..
2022.01.07 -
문제 번호 : 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 -
문제 번호 : 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