結果

問題 No.887 Collatz
ユーザー hase_0o0
提出日時 2019-10-26 00:39:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 145 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 82,476 KB
実行使用メモリ 53,656 KB
最終ジャッジ日時 2024-09-13 11:38:55
合計ジャッジ時間 2,375 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())

ans=n
i=0
while n!=1:
    if n%2==0:
        n//=2
    else:
        n=3*n+1
        ans=max(ans,n)
    i+=1
print(i)
print(ans)
0