結果

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

ソースコード

diff #

N = int(input())

count = 0

while True:
    if N == 1:
        break
    if N % 2 == 0:
        N = N // 2
        count += 1
    else:
        N += 1
        N = N // 2
        count += 2

print(count)
0