분류 전체보기
-
[BOJ Bronz - 3] 별찍기 -4카테고리 없음 2024. 4. 2. 09:37
❓문제 설명 구현문제 입력받은 number값만큼 열을 만들고 행도 만들고 별이 한개씩 줄다가 역삼각형 모양이되어야 함 열이 늘어날수록 앞에서부터 공백을 추가하면 됨 ✅ 문제 해결 문제는 간단하게 해결이 되었는데 백준에서 입력하는 방식에서 실패가 많이 나와서 원인을 찾는데 시간이 오래걸림 const fs = require("fs"); const input = fs.readFileSync("/dev/stdin").toString().trim(); const solution = (input) => { let result = []; for (let i = 0; i < input; i++) { result[i] = " ".repeat(i) + "*".repeat(input - i); } return result...
-
[BOJ - Bronz 1] 기상청 인턴 신현수카테고리 없음 2024. 3. 25. 13:58
❓문제 설명 누적합을 구하는 문제로 주어진 배열에 대해서 주어진 값 K만큼의 누적합 중 가장 큰 수를 구하는 문제이다. ✅ 문제 해결 누적합을 구하기 위해서 reduce와 반복문을 사용했으며 2중반복문이 나오는 구조가 되는 것이 조금 아쉽지만 어쩔 수 없다는 생각이 들었다. 아래의 방식으로 코드를 구성했을 때 배열을 생성하는 부분에서 재대로 값이 나오지 않아서 아래에 있는 식을 참고해서 다시 코드를 구성하게 되었다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); let linesRead = 0; let inputData = []..
-
[혼공컴운] 보조기억장치네트워크/CS Study 2024. 3. 24. 16:40
개요 1. 다양한 보조기억장치 - 하드디스크 - 플래시 메모리 2. RAID의 정의와 종류 - RAID의 정의 - RAID의 종류 ✅ 다양한 보조기억장치 보조기억장치는 대중적으로 하드 디스크와 플래시 메모리가 있으며 흔히 사용되는 USB, SD카드, SSD와 같은 저장장치를 말합니다. 📦 하드 디스크 자기적인 방식으로 데이터를 저장하는 보조기억장치로 자기 디스크의 일종으로 지칭하기도 한다. 동작을 LP나 CD와 비슷하게 동작하며 동그란 원판에 데이터를 저장하고 뾰족한 리더기로 회전하는 원판에 데이터를 읽는다. 플래터: 실질적으로 데이터가 저장되는 곳(동그란 원판)으로 수많은 N극과 S극을 저장하며 N극, S극은 0과 1의 역할을 한다. 스핀들: 플래터를 회전시키는 구성 요소 RPM: 스핀들이 플래터를 돌..
-
[프그래머스 2단계] 두 원 사이의 정수 쌍알고리즘 2024. 3. 23. 20:52
❓문제 설명 두 개의 반지름을 받을 것임 이것을 통해서 만들어진 2개의 원이 있는데 이 원들이 가지는 정수 좌표값 중 공통된 것을 빼고 나머지를 구하는 것임 ✅ 문제 해결 원의 반지름을 통해서 정수좌표를 어떻게 구할 수 있을지 알아보았으며 x2 + y2 = r2이 공식을 통해서 구할 수 있는 방법을 알아보았음 큰 원의 정수좌표를 객체로 만들고 작은 원의 정수좌표를 구할 때 공통된 것이 있다면 객체에서 없애보자. function solution(r1, r2) { var answer = 0; for(var x = 1;xx){ var minY = Math.ceil(Math.sqrt(r1**2 - x**2)); } else{ var minY = 0; } answer+= (maxY - minY + 1); } re..