반응형

Prob


Approach

1부터 N번 째 "666"을 포함한 숫자가 나올 때까지 검사한다.


Code

if __name__ == "__main__" :
    N = int(input())
    num = []
    m_str = "666"
    i = 1
    cnt = 0
    while(True):
        if m_str in str(i):
            cnt += 1
            if cnt == N:
                print(i)
                break
        i += 1

 

출처

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

반응형
블로그 이미지

Refrin

일상생활 끄적 IT 프로젝트 끄적