結果

問題 No.887 Collatz
ユーザー Nagisa
提出日時 2019-09-20 21:24:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 187 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-09-14 16:10:45
合計ジャッジ時間 2,321 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ans = 0
c = 0
while True:
    ans = max(ans,n)
    c += 1
    if n%2 == 0:
        n //= 2
    else:
        n = 3*n + 1
    if n == 1:
        break
print(c)
print(ans)
0