Skip to content

Conversation

@ShinHeeEul
Copy link
Contributor

🧷 문제 링크

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

🧭 풀이 시간

20 분

👀 체감 난이도

✏️ 문제 설명

창영이는 4와 7로 이루어진 수를 좋아한다. 창영이가 좋아하는 수 중에 K번째 작은 수를 구해 출력하는 프로그램을 작성하시오.

🔍 풀이 방법

자릿수의 마지막 번호는 2, (2 + 4), (2 + 4 + 8) 식으로 늘어난다.
N이 포함된 자릿수를 구하고(자릿수를 k라 하면)

이전 자릿수의 마지막 번호(2 + 4) + $2^{k-1}$이 N보다 크다면? N의 맨 앞 자리 값이 7이고,
N보다 작다면? N의 맨 앞 자리 값이 4이다.

이를 활용해서 계산한다.

⏳ 회고

엠로 코딩 테스트에서 나온 문제이다.

@ShinHeeEul ShinHeeEul added the success 👍 해설을 보지 않고 풀었을 때 label Mar 20, 2025
@ShinHeeEul ShinHeeEul self-assigned this Mar 20, 2025
@ShinHeeEul ShinHeeEul merged commit ded0b18 into main Mar 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants