結果

問題 No.2534 コラッツ数列
ユーザー Pregina
提出日時 2023-12-10 22:37:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 237 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 52,096 KB
最終ジャッジ日時 2024-09-27 04:09:28
合計ジャッジ時間 2,454 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
P = 0
while True:
    P += 1
    if P > 50:
        print('No')
        break
    if N == 1:
        print('Yes')
        print(P+1)
        break
    if N%2 == 0:
        N //= 2
    else:
        N = 3*N + 1
    P += 1
0