[바미] 큐 2
·
하루 알고리즘(JS)
문제https://www.acmicpc.net/problem/18258코드const fs = require('fs');const input = fs.readFileSync('/dev/stdin').toString().trim().split('\n');const N = parseInt(input[0], 10); // 명령의 수const commands = input.slice(1); // 명령 리스트class Queue { constructor() { this.queue = []; this.frontIndex = 0; this.backIndex = 0; } push(x) { this.queue[this.backIndex++] = x;..