Minji Log
close
프로필 배경
프로필 로고

Minji Log

  • 분류 전체보기 (65)
    • HTML&CSS (2)
    • Javascript (12)
    • Typescript (1)
    • React (6)
    • Next.js (2)
    • Node.js (2)
    • 코딩문제풀기 (20)
    • 기타 (1)
    • 🔥 프로젝트 (16)
    • 🐞 버그 모음 (2)
    • ✏️ 끄적끄적 (1)
  • 홈
  • 방명록

[백준] 3085 | 사탕 게임 | 자바스크립트

문제https://www.acmicpc.net/problem/3085 정답 코드const fs = require("fs");const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt";const input = fs.readFileSync(filePath).toString().trim().split("\n");const checkMaxCount = (candy, maxCount) => { // 행체크 for (let row of candy) { let count = 1; for (let i = 0; i index !== 0).map((c) => c.split("")); let maxCount = 0; for (..

  • format_list_bulleted 코딩문제풀기
  • · 2025. 1. 10.
  • textsms

[백준] 2309 | 일곱 난쟁이 | 자바스크립트

문제https://www.acmicpc.net/problem/2309 정답 코드const fs = require("fs");const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt";const input = fs .readFileSync(filePath) .toString() .trim() .split("\n") .map((num) => Number(num));function solution(input) { let result; const sum = input.reduce((acc, cur) => { return acc + cur; }, 0); // 이중 for문으로 두 명의 난쟁이를 찾는다 for (l..

  • format_list_bulleted 코딩문제풀기
  • · 2025. 1. 8.
  • textsms

[백준] 10799 | 쇠막대기 | 자바스크립트

문제https://www.acmicpc.net/problem/10799 정답 코드const fs = require("fs");const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt";const input = fs.readFileSync(filePath).toString().trim();function solution(input) { const stack = []; let result = 0; // 레이저인지 막대기의 끝인지 구분하기 위한 변수 let prev = ""; for (let i = 0; i "(" 가 나오면 스택에 추가")" 가 나오면 스택에서 제거, 이전 문자가 "(" 이면 레이저 ")" 이면 막대기의 ..

  • format_list_bulleted 코딩문제풀기
  • · 2025. 1. 3.
  • textsms

[백준] 2525 | 오븐 시계 | 자바스크립트

문제https://www.acmicpc.net/problem/2525 정답 코드const fs = require("fs");const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt";const input = fs.readFileSync(filePath).toString().trim().split("\n");const getCookingTime = (hour, minutes, time) => { let newMinutes = minutes + time; let newHour = hour; if (newMinutes > 59) { newHour += parseInt(newMinutes / 60); newMinute..

  • format_list_bulleted 코딩문제풀기
  • · 2025. 1. 3.
  • textsms

[백준] 10866 | 덱 | 자바스크립트

문제https://www.acmicpc.net/problem/10866 정답 코드const fs = require("fs");const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt";const input = fs.readFileSync(filePath).toString().trim().split("\n");class Deque { #array; constructor() { this.#array = []; } // 정수 x 를 덱의 앞에 넣는다. pushFront(value) { this.#array.unshift(value); } // 정수 x 를 덱의 뒤에 넣는다. pushBack(value) { ..

  • format_list_bulleted 코딩문제풀기
  • · 2024. 12. 30.
  • textsms

[백준] 14681 | 사분면 고르기 | 자바스크립트

문제https://www.acmicpc.net/problem/14681 정답 코드해당 문제를 기존에 사용하던 방식대로 fs 모듈을 활용해 입력을 처리했더니, Error: EACCES: permission denied 라는 런타임 오류가 발생했다. 알고보니 문제마다 입력받는 방식에 차이가 있을 수 있나보다. 🧐 이 문제는 fs 모듈 대신 readline 모듈을 사용하거나 readFileSync(0) 을 사용해야한다. readline 모듈 방식const readline = require("readline");const rl = readline.createInterface({ input: process.stdin, output: process.stdout,});const getQuadrant = (x, ..

  • format_list_bulleted 코딩문제풀기
  • · 2024. 12. 30.
  • textsms
  • navigate_before
  • 1
  • 2
  • 3
  • 4
  • navigate_next
전체 카테고리
  • 분류 전체보기 (65)
    • HTML&CSS (2)
    • Javascript (12)
    • Typescript (1)
    • React (6)
    • Next.js (2)
    • Node.js (2)
    • 코딩문제풀기 (20)
    • 기타 (1)
    • 🔥 프로젝트 (16)
    • 🐞 버그 모음 (2)
    • ✏️ 끄적끄적 (1)
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바