結果

問題 No.887 Collatz
ユーザー gorugo30
提出日時 2021-02-23 12:55:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 211 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 82,164 KB
実行使用メモリ 53,748 KB
最終ジャッジ日時 2024-09-22 08:28:07
合計ジャッジ時間 2,370 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
i1 = -1
nmax = N
i = 0
while i1 == -1:
    if N % 2:
        N = 3 * N + 1
    else:
        N = N // 2
    if N == 1:
        i1 = i
    nmax = max(nmax, N)
    i += 1
print(i1 + 1)
print(nmax)
0