結果

問題 No.378 名声値を稼ごう
ユーザー 👑 yumechiyumechi
提出日時 2016-08-06 01:08:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 1,623 ms
コンパイル使用メモリ 86,720 KB
実行使用メモリ 71,500 KB
最終ジャッジ日時 2023-09-12 01:08:34
合計ジャッジ時間 2,333 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,500 KB
testcase_01 AC 68 ms
71,352 KB
testcase_02 AC 69 ms
71,384 KB
testcase_03 AC 69 ms
71,268 KB
testcase_04 AC 70 ms
71,132 KB
testcase_05 AC 70 ms
70,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    n = int(input())
    arr, nc = [], n
    while nc > 0:
        arr.append(nc)
        nc //= 2
    arr.append(0)
    standardscore = sum(arr)
    print(arr[0] + arr[1] * 2 + (arr[0] % 2 == 1 if 1 else 0) - standardscore)

if __name__=="__main__":
    solve()
0