結果

問題 No.642 Two Operations No.1
ユーザー kjnhokjnho
提出日時 2018-02-02 22:29:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 340 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 87,264 KB
実行使用メモリ 71,708 KB
最終ジャッジ日時 2023-08-30 02:17:12
合計ジャッジ時間 2,415 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 72 ms
70,980 KB
testcase_02 AC 72 ms
71,280 KB
testcase_03 AC 72 ms
71,120 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 73 ms
71,288 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 72 ms
71,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# input
def solve():
    N = int(input())

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

    print(count)
        

if __name__ == "__main__":
    solve()

0