백준 3578번: Holes #Python

ColorlessDia·2025년 5월 7일

algorithm/baekjoon

목록 보기
535/807
def matched_string(hole):
    
    if hole < 2:
        return int(not hole)
    
    return int(('4' * (hole % 2)) + ('8' * (hole // 2)))

h = int(input())

print(matched_string(h))

0개의 댓글