Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- js 스코프
- emtion app router
- 자바스크립트 스코프
- suspense 비동기
- 카카오 코테
- 프로그래머스 문자열 압축
- 구름톤 챌린지
- 구름톤 챌린지 회고
- js 거리두기 확인하기
- 옵셔널체이닝
- js
- 백준 1339번 자바스크립트
- next13 emotion
- 백준 2108 nodejs
- 백준 2108 자바스크립트
- 리액트쿼리 suspense
- 백준 1339번 js
- js 문자열 압축
- suspense 병목현상
- suspense 동작원리
- 프로그래머스 거리두기 확인하기
- 구름톤
- suspense react-query
- 사용성 개선
- emotion RSC
- app router emotion
- 자바스크립트 문자열 압축
- 스코프
- 백준 1339번 nodejs
- TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more:
Archives
- Today
- Total
Lennon FE
[백준 2869번] 달팽이는 올라가고 싶다 - 자바스크립트(nodejs) 본문
728x90
반응형
https://www.acmicpc.net/problem/2869
2869번: 달팽이는 올라가고 싶다
첫째 줄에 세 정수 A, B, V가 공백으로 구분되어서 주어진다. (1 ≤ B < A ≤ V ≤ 1,000,000,000)
www.acmicpc.net
const fs = require('fs');
let input = fs
.readFileSync('dev/stdin', 'utf-8')
.toString()
.trim()
.split(' ')
.map((v) => +v);
const A = input.shift();
const B = input.shift();
const V = input.shift();
console.log(Math.ceil((V - B) / (A - B)));
처음에 아무생각없이 와일문으로 풀었지만 시간부족이 뜨길래 뭐지? 하고 보니 시간부족 해결이 주된 문제였다.
콘솔 안 계산이 딱 떨어지지 않는다는 건 하루가 더 필요한 것이므로 올림 해주면 깔끔하게 해결된다.
728x90
반응형
'🔥 Algorithm > Baekjoon' 카테고리의 다른 글
[백준 9020번] 골드바흐의 추측 - 자바스크립트(nodejs) (0) | 2022.01.18 |
---|---|
[백준 4948번] 베르트랑 공준 - 자바스크립트(nodejs) (0) | 2022.01.17 |
[백준 2775번] 부녀회장이 될테야 - 자바스크립트(nodejs) (0) | 2022.01.17 |
[백준 1316번] 그룹 단어 체커 - 자바스크립트(nodejs) (0) | 2022.01.17 |
[백준 2941] 크로아티아 알파벳 자바스크립트(nodejs) (0) | 2022.01.17 |
Comments