結果

問題 No.642 Two Operations No.1
ユーザー surprise_tanaka
提出日時 2018-12-04 15:47:34
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 180 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-07-07 15:19:11
合計ジャッジ時間 1,057 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
count = 0
while True:
    if N == 1:
        break
    if N % 2 != 0:
        N += 1
        count += 1
    else:
        N //= 2
        count += 1
print(count)  
0