結果

問題 No.642 Two Operations No.1
ユーザー 👑 rin204rin204
提出日時 2022-01-19 21:09:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 122 bytes
コンパイル時間 603 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 71,376 KB
最終ジャッジ日時 2023-08-15 08:09:40
合計ジャッジ時間 2,066 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
71,164 KB
testcase_01 AC 63 ms
71,288 KB
testcase_02 AC 63 ms
71,148 KB
testcase_03 AC 64 ms
71,356 KB
testcase_04 AC 65 ms
71,188 KB
testcase_05 AC 61 ms
71,328 KB
testcase_06 AC 60 ms
71,096 KB
testcase_07 AC 60 ms
71,032 KB
testcase_08 AC 61 ms
71,292 KB
testcase_09 AC 60 ms
71,376 KB
testcase_10 AC 62 ms
71,220 KB
testcase_11 AC 60 ms
71,152 KB
testcase_12 AC 60 ms
71,292 KB
testcase_13 AC 59 ms
71,352 KB
testcase_14 AC 63 ms
71,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ans = 0
while n != 1:
    if n % 2 == 1:
        n += 1
    else:
        n //= 2
    ans += 1
print(ans)
0