-
[문제풀이 후기] 백준 #3733 - Shares문제풀이/Baekjoon 2025. 12. 21. 16:36
https://www.acmicpc.net/problem/3733
문제 포인트
1. A group of N persons and the ACM Chief Judge share equally a number of S shares.
2. x is the number of shares acquired by each person.
3. return the maximum value of x.- S 는 N명과 Judge, 총 N+1 명이 동등하게 나눠 가진다.
- 동등하게 가져갈 수 있는 최대값을 구하면 된다.
첫 번째 시도 (결과 : 성공)
접근 방식
1. s 를 n+1 로 나눈다.
2. Math.floor() 를 사용하여 몫만 출력한다.import { readFileSync } from "fs"; const input = readFileSync(0).toString().trim(); const array = input.split("\n").map((value) => { const [n, s] = value.split(" ").map(Number); return Math.floor(s / (n + 1)); }); console.log(array.join("\n"));후기
아무리 문제가 외국어라도 해석만 잘하면 된다.
'문제풀이 > Baekjoon' 카테고리의 다른 글
[문제풀이 후기] 백준 #14928 - 큰 수 (BIG) (0) 2025.12.22 [문제풀이 후기] 백준 #34446 - E-Days Ore Cart Pull (0) 2025.12.21 [문제풀이 후기] 백준 #1193 - 분수찾기 (0) 2025.12.17 [문제풀이 후기] 백준 #2869 - 달팽이는 올라가고 싶다 (0) 2025.12.17 [문제풀이 후기] 백준 #2563 - 색종이 (0) 2025.12.10