Skip to content

Conversation

@Ukj0ng
Copy link
Contributor

@Ukj0ng Ukj0ng commented Oct 2, 2025

🧷 문제 링크

https://www.acmicpc.net/problem/4781

🧭 풀이 시간

30분

👀 체감 난이도

✏️ 문제 설명

배낭 문제

🔍 풀이 방법

기본 문제

⏳ 회고

0.29를 컴퓨터에 저장하면
→ 실제로는 0.28999999999999998... 로 저장됨

이걸 100 곱하면
→ 28.999999999999998...

여기서 int()로 소수점 버리면
→ 28 (원래는 29여야 하는데!)

문제 상황

int(0.29 * 100) # 28 ❌

해결

int(0.29 * 100 + 0.5) # 29 ✅

28.9999... + 0.5 = 29.4999... → int() → 29

그렇다네요.....

@JHLEE325 JHLEE325 merged commit 30ac053 into main Oct 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants