문제https://www.acmicpc.net/problem/2841풀이1. Node.js(fs)const fs = require('fs');const input = fs.readFileSync('/dev/stdin').toString().trim().split('\n');// 첫 번째 줄에서 음의 수 N과 프렛의 수 P를 파싱const [N, P] = input[0].split(' ').map(Number);// 각 줄별로 프렛을 누르고 있는 상태를 저장할 배열const strings = Array.from({ length: 7 }, () => []);let fingerMoves = 0;// 각 음을 처리for (let i = 1; i 0 && strings[string][strings[string]..
문제https://www.acmicpc.net/problem/2716풀이1. Node.js(fs)const fs = require('fs');const input = fs.readFileSync('/dev/stdin').toString().trim().split('\n');// 테스트 케이스 수 파싱const N = parseInt(input[0]);// 각 테스트 케이스에 대한 결과를 저장할 배열const results = [];// 덩굴 구조를 분석하는 함수function analyzeVine(structure) { let depth = 0; let maxDepth = 0; // 문자열의 각 문자를 순회 for (let char of structure) { i..