結果

問題 No.887 Collatz
ユーザー kawacchu
提出日時 2019-09-21 01:59:59
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 196 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-09-15 07:40:12
合計ジャッジ時間 1,984 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ans1 = n
ans2 = 0
while n != 1 :
    if n % 2 :
        tmp = 3*n + 1
        ans1 = max(n, tmp)
        n = tmp
    else :
        n //= 2
    ans2 += 1

print(ans1)
print(ans2)
0