javascript
-
문제 번호 : 14225 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/14225 const fs = require('fs'); const { deflateSync } = require('zlib'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\n'); let tables = new Array(2000001).fill(false); const N = Number(input.shift()); const S = input[0].split(' ').map(Number);..
[BaekJoon] 41225 번 부분수열의 합 문제 - (nodejs)문제 번호 : 14225 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/14225 const fs = require('fs'); const { deflateSync } = require('zlib'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\n'); let tables = new Array(2000001).fill(false); const N = Number(input.shift()); const S = input[0].split(' ').map(Number);..
2022.01.11 -
문제 번호 : 7795 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/7795 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\r\n'); const T = Number(input.shift()); const binary_search = (arr, data) => { let low = 0; let high = arr.length-1; let result = -1; while (low Number(el)); input.shif..
[BaekJoon] X 번 X 문제 - (nodejs)문제 번호 : 7795 번 문제 바로가기 ☞ https://www.acmicpc.net/problem/7795 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\r\n'); const T = Number(input.shift()); const binary_search = (arr, data) => { let low = 0; let high = arr.length-1; let result = -1; while (low Number(el)); input.shif..
2022.01.11 -
문제 번호 : 2696번 문제 바로가기 ☞ https://www.acmicpc.net/problem/2696 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\n'); const N = Number(input.shift()); class Heap{ constructor(){ this.node = []; } insert(data, status){ this.node.push(data); let child = this.node.length-1; if(status ..
[BaekJoon] 2696 번 중앙값 구하기 문제 - (nodejs)문제 번호 : 2696번 문제 바로가기 ☞ https://www.acmicpc.net/problem/2696 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim().split('\n'); const N = Number(input.shift()); class Heap{ constructor(){ this.node = []; } insert(data, status){ this.node.push(data); let child = this.node.length-1; if(status ..
2022.01.10 -
문제 번호 : 1655번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1655 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim(); let [n, ...arr] = input.split('\n').map((el) => Number(el)); class Heap{ constructor(){ this.node = []; } insert(data, status){ this.node.push(data); let child = this.node.leng..
[BaekJoon] 1655번 가운데를 말해요 문제 - (nodejs)문제 번호 : 1655번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1655 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().trim(); let [n, ...arr] = input.split('\n').map((el) => Number(el)); class Heap{ constructor(){ this.node = []; } insert(data, status){ this.node.push(data); let child = this.node.leng..
2022.01.10 -
문제 번호 : 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