結果
| 問題 | 
                            No.887 Collatz
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-05-07 21:06:44 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 41 ms / 2,000 ms | 
| コード長 | 225 bytes | 
| コンパイル時間 | 142 ms | 
| コンパイル使用メモリ | 82,028 KB | 
| 実行使用メモリ | 52,096 KB | 
| 最終ジャッジ日時 | 2024-09-15 08:49:44 | 
| 合計ジャッジ時間 | 2,319 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 28 | 
ソースコード
n0 = int(input())
cnt = 0
max_n = n0
while 1:
    if n0 == 1:
        print(cnt)
        print(max_n)
        break
    else:
        n0 = n0//2 if n0%2 == 0 else 3*n0+1
        max_n = max(max_n,n0)
    cnt += 1