BOJ - 14920 - 3n+1 수열 Updated: August 22, 2020 def solution(): N = int(input()) count = 1 while True: if N == 1: break if N % 2: N = N * 3 + 1 else: N //= 2 count += 1 print(count) solution() https://www.acmicpc.net/problem/14920 Share on Twitter Facebook LinkedIn Previous Next Leave a comment
Leave a comment