結果
| 問題 | 
                            No.2534 コラッツ数列
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-11-10 21:27:26 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 141 ms / 2,000 ms | 
| コード長 | 486 bytes | 
| コンパイル時間 | 195 ms | 
| コンパイル使用メモリ | 82,048 KB | 
| 実行使用メモリ | 85,888 KB | 
| 最終ジャッジ日時 | 2024-09-26 01:05:24 | 
| 合計ジャッジ時間 | 5,639 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 33 | 
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
n = int(input())
#alist = list(map(int,input().split()))
#alist = []
#s = input()
ans = 1
for i in range(51):
    ans += 1
    if n == 1:
        if ans > 50:
            exit(print('No'))
        print('Yes')
        exit(print(ans))
    
    if n % 2 == 0:
        n //= 2
    else:
        n = 3*n+1
    ans += 1
print('No')