-
[문제풀이 후기] 백준 #34446 - E-Days Ore Cart Pull문제풀이/Baekjoon 2025. 12. 21. 16:59
https://www.acmicpc.net/problem/34446\
문제 포인트
1. Students parade from Golden, down Colfax Avenue, to the state capitol.
2. At the capitol, the ore cart is taken back to Golden.- 카트는 Golden 부터 Capitol 까지 갔다가 다시 Golden 으로 돌아온다.
Input
- 1st Line : Distance(mile) from Golden to the capitol
- 2nd Line : the number of students
- 3nd Line : the air temperature at the capitol
Output
: The number of miles the ore cart traveled- 카트가 이동한 총 거리만 필요하다.
- 따라서 정답은 첫번째 라인의 값 * 2 (왕복) 다.
첫 번째 시도 (결과 : 성공)
접근 방식
입력값을 라인별로 split 해서 첫번쨰 값만 사용
import { readFileSync } from "fs"; const input = readFileSync("./input.txt").toString().trim(); const [mile] = input.split('\n'); console.log(2 * Number(mile));후기
외국어도 문제에 함정 넣는건 마찬가지구나.. 해석 잘해야겠다.
'문제풀이 > Baekjoon' 카테고리의 다른 글
[문제풀이 후기] 백준 #27434 - 팩토리얼 3 (0) 2026.01.02 [문제풀이 후기] 백준 #14928 - 큰 수 (BIG) (0) 2025.12.22 [문제풀이 후기] 백준 #3733 - Shares (0) 2025.12.21 [문제풀이 후기] 백준 #1193 - 분수찾기 (0) 2025.12.17 [문제풀이 후기] 백준 #2869 - 달팽이는 올라가고 싶다 (0) 2025.12.17